controlli aggiunti
Fork of AX12 by
Diff: AX12.h
- Revision:
- 2:5ea99c37a2d7
- Parent:
- 1:93ad80f5fde7
- Child:
- 3:ced71d1b2558
diff -r 93ad80f5fde7 -r 5ea99c37a2d7 AX12.h --- a/AX12.h Wed Mar 30 16:08:02 2011 +0000 +++ b/AX12.h Sun Apr 10 20:58:21 2011 +0000 @@ -26,10 +26,10 @@ #include "mbed.h" -#define AX12_WRITE_DEBUG 0 -#define AX12_READ_DEBUG 0 -#define AX12_TRIGGER_DEBUG 0 -#define AX12_DEBUG 0 +//#define AX12_WRITE_DEBUG 0 +//#define AX12_READ_DEBUG 0 +//#define AX12_TRIGGER_DEBUG 0 +//#define AX12_DEBUG 0 #define AX12_REG_ID 0x3 #define AX12_REG_CW_LIMIT 0x06 @@ -77,7 +77,7 @@ * @param pin rx pin * @param int ID, the Bus ID of the servo 1-255 */ - AX12(PinName tx, PinName rx, int ID); + AX12(PinName tx, PinName rx, int ID, int baud=1000000); /** Set the mode of the servo * @param mode @@ -159,13 +159,15 @@ */ float GetVolts(void); + int read(int ID, int start, int length, char* data); + int write(int ID, int start, int length, char* data, int flag=0); + private : SerialHalfDuplex _ax12; int _ID; + int _baud; - int read(int ID, int start, int length, char* data); - int write(int ID, int start, int length, char* data, int flag=0); };