![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Shows the current positions of the 4 servos on the display...
Dependencies: PR_RobotArmController mbed
Diff: main.cpp
- Revision:
- 0:c1930e7050d1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Mar 03 13:38:24 2017 +0000 @@ -0,0 +1,25 @@ +#include "robotarm.h" + +Robotarm arm; + +int main() +{ + //Run the main initialisation routine + arm.init(); + display.clear_display(); + while(1) { + int base = servo.GetPosition(BASE); + int shoulder = servo.GetPosition(SHOULDER); + int elbow = servo.GetPosition(ELBOW); + int wrist = servo.GetPosition(WRIST); + char s1[17]; + char s2[17]; + sprintf(s1,"B:%4d S:%4d",base,shoulder); + sprintf(s2,"E:%4d W:%4d",elbow,wrist); + display.set_position(0,0); + display.write_string(s1); + display.set_position(1,0); + display.write_string(s2); + wait(0.2); + } +} \ No newline at end of file