Daniele Caltabiano / motorDriver
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers motorDriver.h Source File

motorDriver.h

00001 #ifndef MBED_MOTORDRIVER_H
00002 #define MBED_MOTORDRIVER_H
00003 #include "mbed.h"
00004 #define REQUESTPOSITIONADDR 0x40
00005 #define READBUFFSIZE 3 //reading buffer size
00006 
00007 class motorDriver{
00008 public:
00009     motorDriver(char slaveAddress);
00010     int actualPosition();
00011 private:
00012     char addressConverter(char sevenBitAddress); 
00013     int charArrayToInt(char *array, int size);  
00014     void requestData(char addr, char requestedData ,char *buff, int size);
00015     char _i2cAddr;  
00016     char _readBuffer[READBUFFSIZE];
00017 }