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.h@3:1f47375270c5, 2016-11-02 (annotated)
- Committer:
- ronvbree
- Date:
- Wed Nov 02 09:10:43 2016 +0000
- Revision:
- 3:1f47375270c5
- Parent:
- 2:fc869e45e672
- Child:
- 7:a80cb6b06320
abcdefgj
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ronvbree | 2:fc869e45e672 | 1 | #include "arm.h" |
| ronvbree | 2:fc869e45e672 | 2 | |
| ronvbree | 2:fc869e45e672 | 3 | class Robot { |
| ronvbree | 2:fc869e45e672 | 4 | private: |
| ronvbree | 2:fc869e45e672 | 5 | // Arms |
| ronvbree | 2:fc869e45e672 | 6 | Arm upperArm; |
| ronvbree | 2:fc869e45e672 | 7 | Arm lowerArm; |
| ronvbree | 2:fc869e45e672 | 8 | // Roller position |
| ronvbree | 2:fc869e45e672 | 9 | float x; |
| ronvbree | 2:fc869e45e672 | 10 | float y; |
| ronvbree | 2:fc869e45e672 | 11 | // Ticker |
| ronvbree | 2:fc869e45e672 | 12 | Ticker ticker; |
| ronvbree | 2:fc869e45e672 | 13 | // Safety button |
| ronvbree | 2:fc869e45e672 | 14 | InterruptIn killButton; |
| ronvbree | 2:fc869e45e672 | 15 | |
| ronvbree | 2:fc869e45e672 | 16 | void doTick(); |
| ronvbree | 2:fc869e45e672 | 17 | |
| ronvbree | 2:fc869e45e672 | 18 | public: |
| ronvbree | 2:fc869e45e672 | 19 | Robot(); |
| ronvbree | 2:fc869e45e672 | 20 | // void setX(float x); |
| ronvbree | 2:fc869e45e672 | 21 | // void setY(float y); |
| ronvbree | 2:fc869e45e672 | 22 | // Move only on the x axis |
| ronvbree | 2:fc869e45e672 | 23 | void moveX(float dx); |
| ronvbree | 2:fc869e45e672 | 24 | // Move only on the y axis |
| ronvbree | 2:fc869e45e672 | 25 | void moveY(float dy); |
| ronvbree | 2:fc869e45e672 | 26 | // Set arm lengths |
| ronvbree | 2:fc869e45e672 | 27 | // void setArms(float upper, float lower); |
| ronvbree | 3:1f47375270c5 | 28 | // Get upper arm length |
| ronvbree | 3:1f47375270c5 | 29 | float getUpperArmLength(); |
| ronvbree | 3:1f47375270c5 | 30 | // Get lower arm length |
| ronvbree | 3:1f47375270c5 | 31 | float getLowerArmLength(); |
| ronvbree | 2:fc869e45e672 | 32 | // Set upper arm velocity |
| ronvbree | 2:fc869e45e672 | 33 | void setUpperArmVelocity(float referenceVelocity); |
| ronvbree | 2:fc869e45e672 | 34 | // Set lower arm velocity |
| ronvbree | 2:fc869e45e672 | 35 | void setLowerArmVelocity(float referenceVelocity); |
| ronvbree | 2:fc869e45e672 | 36 | // Safety shutdown |
| ronvbree | 2:fc869e45e672 | 37 | void kill(); |
| ronvbree | 2:fc869e45e672 | 38 | |
| ronvbree | 2:fc869e45e672 | 39 | }; |
| ronvbree | 2:fc869e45e672 | 40 | |
| ronvbree | 2:fc869e45e672 | 41 | |
| ronvbree | 2:fc869e45e672 | 42 |