/******************************************************************************
Servo Header file

Michael Simmons
Master Project:
Date Created:	25 Oct 2008
Date Modified:	25 Oct 2008

*******************************************************************************

Description:
	The Servo class is designed to control servos from the PWM pins on the
        robostix.

******************************************************************************/

#ifndef SERVO_H
#define SERVO_H

#include "I2cDef.h"

class Servo
{
  private:
    int i2cHandle;
    int turnL;
    int turnR;
//    I2cLine *i2cLAddr;
    uint8_t avrAddr;
//    int i2cHandle;
//    uint8_t portd;
//    uint8_t regValue;
    uint16_t lowVal;
    uint16_t highVal;
    uint16_t centerVal;
    uint16_t rangeVal;
    uint8_t servoNum;
    struct I2c_rdwr_ioctl_data rdwr;
    struct I2c_msg msg[2];
    uint8_t buf[I2c_max_len + 3];
    I2c_write_t writeReg;

  public:
    Servo( int, int, int, int );
    int center();
    int left( int );
    int right( int );
 
}; //SERVO_H

#endif

