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
robot_test.cpp@29:1c5254b27851, 2016-11-04 (annotated)
- Committer:
- Jankoekenpan
- Date:
- Fri Nov 04 13:26:28 2016 +0000
- Revision:
- 29:1c5254b27851
- Parent:
- 7:a80cb6b06320
documented the processEMG function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ronvbree | 7:a80cb6b06320 | 1 | //#include "robot.h" |
ronvbree | 7:a80cb6b06320 | 2 | //#include "geometry.h" |
ronvbree | 7:a80cb6b06320 | 3 | // |
ronvbree | 7:a80cb6b06320 | 4 | //Serial pc(USBTX, USBRX); |
ronvbree | 7:a80cb6b06320 | 5 | // |
ronvbree | 7:a80cb6b06320 | 6 | //AnalogIn upperPotMeter(A0); |
ronvbree | 7:a80cb6b06320 | 7 | //AnalogIn lowerPotMeter(A1); |
ronvbree | 7:a80cb6b06320 | 8 | // |
ronvbree | 7:a80cb6b06320 | 9 | //InterruptIn button(D2); |
ronvbree | 7:a80cb6b06320 | 10 | //InterruptIn killButton(D3); |
ronvbree | 7:a80cb6b06320 | 11 | // |
ronvbree | 7:a80cb6b06320 | 12 | //Robot robot; |
ronvbree | 7:a80cb6b06320 | 13 | // |
ronvbree | 7:a80cb6b06320 | 14 | //void readArmLengths(float &upper, float &lower) { |
ronvbree | 7:a80cb6b06320 | 15 | // upper = L_min + (L_max - L_min) * upperPotMeter; |
ronvbree | 7:a80cb6b06320 | 16 | // lower = L_min + (L_max - L_min) * lowerPotMeter; |
ronvbree | 7:a80cb6b06320 | 17 | //} |
ronvbree | 7:a80cb6b06320 | 18 | // |
ronvbree | 7:a80cb6b06320 | 19 | //void onButtonPress() { |
ronvbree | 7:a80cb6b06320 | 20 | // float upper; |
ronvbree | 7:a80cb6b06320 | 21 | // float lower; |
ronvbree | 7:a80cb6b06320 | 22 | // readArmLengths(upper, lower); |
ronvbree | 7:a80cb6b06320 | 23 | // |
ronvbree | 7:a80cb6b06320 | 24 | // pc.printf("Reference: Lower: %f, Upper: %f\n\r", lower, upper); |
ronvbree | 7:a80cb6b06320 | 25 | // pc.printf("Encoder: Lower: %f, Upper: %f\n\r", robot.getLowerArmLength(), robot.getUpperArmLength()); |
ronvbree | 7:a80cb6b06320 | 26 | // |
ronvbree | 7:a80cb6b06320 | 27 | // robot.setUpperArmLength(upper); |
ronvbree | 7:a80cb6b06320 | 28 | // robot.setLowerArmLength(lower); |
ronvbree | 7:a80cb6b06320 | 29 | // |
ronvbree | 7:a80cb6b06320 | 30 | //// robot.setLowerArmVelocity(2); |
ronvbree | 7:a80cb6b06320 | 31 | //// robot.setUpperArmVelocity(1); |
ronvbree | 7:a80cb6b06320 | 32 | // |
ronvbree | 7:a80cb6b06320 | 33 | //} |
ronvbree | 7:a80cb6b06320 | 34 | // |
ronvbree | 7:a80cb6b06320 | 35 | //int main() { |
ronvbree | 7:a80cb6b06320 | 36 | // pc.baud(115200); |
ronvbree | 7:a80cb6b06320 | 37 | // button.fall(&onButtonPress); |
ronvbree | 7:a80cb6b06320 | 38 | // killButton.fall(&robot, &Robot::kill); |
ronvbree | 7:a80cb6b06320 | 39 | // pc.printf("Test\n\r"); |
ronvbree | 7:a80cb6b06320 | 40 | // while (true); |
ronvbree | 7:a80cb6b06320 | 41 | //} |