Abe Takumi
/
RS405CB_test
meister2013 control test program
Diff: main.cpp
- Revision:
- 0:6e1fdd3ca40d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Aug 05 08:06:42 2013 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +//header to use rs405cb class +#include "RS405cb.h" + +//make object +RS405cb servo(p28,p27,p21);//TX,RX,PERMIT (PERMIT means RE/DE Pin of ltc485) + +//main +int main() { + TORQUE_ON(1); //means "make torque on of servo whose id is 1." + while(1) { + Rotate_Servo_Float(1,-90.0);//means "change angle to -90.0 degree :ID=1" angle scope:-90.0 to -90.0 + wait(1.0); + Rotate_Servo_Float(1,0.0); + wait(1.0); + Rotate_Servo_Float(1,90.0); + wait(1.0); + Rotate_Servo_Float(1,0.0); + wait(1.0); + } +}