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 QEI biquadFilter
Diff: robot_test.cpp
- Revision:
- 7:a80cb6b06320
- Parent:
- 3:1f47375270c5
--- a/robot_test.cpp Wed Nov 02 09:26:38 2016 +0000
+++ b/robot_test.cpp Wed Nov 02 16:29:13 2016 +0000
@@ -1,39 +1,41 @@
-#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("Reference: Lower: %f, Upper: %f\n\r", lower, upper);
- pc.printf("Encoder: Lower: %f, Upper: %f\n\r", robot.getLowerArmLength(), robot.getUpperArmLength());
-
-// 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);
-}
+//#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("Reference: Lower: %f, Upper: %f\n\r", lower, upper);
+// pc.printf("Encoder: Lower: %f, Upper: %f\n\r", robot.getLowerArmLength(), robot.getUpperArmLength());
+//
+// robot.setUpperArmLength(upper);
+// robot.setLowerArmLength(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);
+//}