Project Paint / Mbed 2 deprecated arm_control

Dependencies:   mbed QEI biquadFilter

Revision:
2:fc869e45e672
Child:
3:1f47375270c5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/robot_test.cpp	Wed Nov 02 08:51:12 2016 +0000
@@ -0,0 +1,38 @@
+#include "robot.h"
+#include "geometry.h"
+
+Serial pc(USBTX, USBRX);
+
+AnalogIn upperPotMeter(A0);
+AnalogIn lowerPotMeter(A1);
+
+InterruptIn button(D2);
+InterruptIn killButton(D3);
+
+Robot robot;
+
+void readArmLengths(float &upper, float &lower) {
+    upper = L_min + (L_max - L_min) * upperPotMeter;
+    lower = L_min + (L_max - L_min) * lowerPotMeter;
+}
+
+void onButtonPress()    {
+    float upper;
+    float lower;
+    readArmLengths(upper, lower);
+    
+    pc.printf("Lower: %f, Upper: %f\n\r", lower, upper);
+    
+//    robot.setArms(upper, lower);
+//    robot.setLowerArmVelocity(2);
+//    robot.setUpperArmVelocity(1);
+    
+}
+
+int main() {
+    pc.baud(115200);
+    button.fall(&onButtonPress);
+    killButton.fall(&robot, &Robot::kill);
+    pc.printf("Test\n\r");
+    while (true);
+}