![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
wheelchair code for alexa integration
Fork of wheelchaircontrol by
wheelchair.h@3:a5e71bfdb492, 2018-07-16 (annotated)
- Committer:
- ryanlin97
- Date:
- Mon Jul 16 20:46:42 2018 +0000
- Revision:
- 3:a5e71bfdb492
- Parent:
- 1:c0beadca1617
- Child:
- 5:e0ccaab3959a
using joystick
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ryanlin97 | 0:fc0c4a184482 | 1 | #ifndef wheelchair |
ryanlin97 | 0:fc0c4a184482 | 2 | #define wheelchair |
ryanlin97 | 0:fc0c4a184482 | 3 | |
ryanlin97 | 0:fc0c4a184482 | 4 | #include "mbed.h" |
ryanlin97 | 3:a5e71bfdb492 | 5 | #include "math.h" |
ryanlin97 | 0:fc0c4a184482 | 6 | |
ryanlin97 | 0:fc0c4a184482 | 7 | #define def (2.5f/3.3f) |
ryanlin97 | 0:fc0c4a184482 | 8 | #define high 3.3f |
ryanlin97 | 3:a5e71bfdb492 | 9 | #define offset .02f |
ryanlin97 | 3:a5e71bfdb492 | 10 | #define low (1.7f/3.3f) |
ryanlin97 | 0:fc0c4a184482 | 11 | #define process .1 |
ryanlin97 | 3:a5e71bfdb492 | 12 | #define xDir D12 //top right two pins |
ryanlin97 | 0:fc0c4a184482 | 13 | #define yDir D13 //top left two pins |
ryanlin97 | 0:fc0c4a184482 | 14 | |
ryanlin97 | 0:fc0c4a184482 | 15 | class Wheelchair |
ryanlin97 | 0:fc0c4a184482 | 16 | { |
ryanlin97 | 0:fc0c4a184482 | 17 | public: |
ryanlin97 | 1:c0beadca1617 | 18 | Wheelchair(PinName xPin, PinName yPin); |
ryanlin97 | 3:a5e71bfdb492 | 19 | void move(float x_coor, float y_coor); |
ryanlin97 | 1:c0beadca1617 | 20 | void forward(); |
ryanlin97 | 1:c0beadca1617 | 21 | void backward(); |
ryanlin97 | 1:c0beadca1617 | 22 | void right(); |
ryanlin97 | 1:c0beadca1617 | 23 | void left(); |
ryanlin97 | 1:c0beadca1617 | 24 | void stop(); |
ryanlin97 | 0:fc0c4a184482 | 25 | |
ryanlin97 | 1:c0beadca1617 | 26 | private: |
ryanlin97 | 3:a5e71bfdb492 | 27 | PwmOut* x; |
ryanlin97 | 3:a5e71bfdb492 | 28 | PwmOut* y; |
ryanlin97 | 1:c0beadca1617 | 29 | |
ryanlin97 | 0:fc0c4a184482 | 30 | }; |
ryanlin97 | 0:fc0c4a184482 | 31 | #endif |