Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Diff: Dynamixel.h
- Revision:
- 0:79e2a8171b16
- Child:
- 1:ef90d942ce78
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dynamixel.h Tue Aug 18 09:15:09 2015 +0000
@@ -0,0 +1,31 @@
+#ifndef DEF_DYNAMIXEL
+#define DEF_DYNAMIXEL
+
+#include "mbed.h"
+// Instruction set
+const unsigned char PING = 0x01;
+const unsigned char READ_DATA = 0x02;
+const unsigned char WRITE_DATA = 0x03;
+const unsigned char REG_WRITE = 0x04;
+const unsigned char ACTION = 0x05;
+const unsigned char RESET = 0x06;
+const unsigned char SYNC_WRITE = 0x83;
+// Control table
+const unsigned char ADDRESS_PRESENT_TEMPERATURE = 0x2B;
+const unsigned char ADDRESS_GOAL_POSITION = 0x1E;
+const unsigned char ADDRESS_LED = 0x19;
+
+class Dynamixel
+{
+public:
+ Dynamixel(PinName tx, PinName rx, PinName txEnable, uint8_t motorID, int baudrate);
+ void ping();
+ void toggleLED(uint8_t ledState);
+ void move(uint16_t position);
+private:
+ Serial m_link;
+ DigitalOut m_txEnable;
+ uint8_t m_motorID;
+ const int m_baudrate;
+};
+#endif
\ No newline at end of file