Shows the current positions of the 4 servos on the display...

Dependencies:   PR_RobotArmController mbed

Files at this revision

API Documentation at this revision

Comitter:
jah128
Date:
Fri Mar 03 13:38:24 2017 +0000
Commit message:
Initial commit;

Changed in this revision

RobotArmController.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RobotArmController.lib	Fri Mar 03 13:38:24 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/jah128/code/PR_RobotArmController/#aa92ba95a4bb
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 03 13:38:24 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file