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
Doodler/Doodler.h@5:8814d6de77d0, 2019-04-13 (annotated)
- Committer:
- el17m2h
- Date:
- Sat Apr 13 17:37:52 2019 +0000
- Revision:
- 5:8814d6de77d0
- Parent:
- 4:8ec314f806ae
- Child:
- 6:848d1e4c1a31
Created an update function for the doodler to change its position depending on the user moving the joystick left or right.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17m2h | 4:8ec314f806ae | 1 | #ifndef DOODLER_H |
| el17m2h | 4:8ec314f806ae | 2 | #define DOODLER_H |
| el17m2h | 4:8ec314f806ae | 3 | |
| el17m2h | 4:8ec314f806ae | 4 | #include "mbed.h" |
| el17m2h | 4:8ec314f806ae | 5 | #include "N5110.h" |
| el17m2h | 4:8ec314f806ae | 6 | #include "Gamepad.h" |
| el17m2h | 4:8ec314f806ae | 7 | #include "Floors.h" |
| el17m2h | 5:8814d6de77d0 | 8 | |
| el17m2h | 4:8ec314f806ae | 9 | class Doodler{ |
| el17m2h | 4:8ec314f806ae | 10 | public: |
| el17m2h | 4:8ec314f806ae | 11 | Doodler(); |
| el17m2h | 4:8ec314f806ae | 12 | ~Doodler(); |
| el17m2h | 5:8814d6de77d0 | 13 | void init(int radius); |
| el17m2h | 4:8ec314f806ae | 14 | void draw(N5110 &lcd); |
| el17m2h | 5:8814d6de77d0 | 15 | void update (Direction d, float mag); |
| el17m2h | 4:8ec314f806ae | 16 | Vector2D get_pos(); |
| el17m2h | 4:8ec314f806ae | 17 | |
| el17m2h | 4:8ec314f806ae | 18 | private: |
| el17m2h | 4:8ec314f806ae | 19 | int _radius; |
| el17m2h | 4:8ec314f806ae | 20 | int _x; |
| el17m2h | 4:8ec314f806ae | 21 | int _y; |
| el17m2h | 5:8814d6de77d0 | 22 | int _speed; |
| el17m2h | 4:8ec314f806ae | 23 | |
| el17m2h | 4:8ec314f806ae | 24 | }; |
| el17m2h | 4:8ec314f806ae | 25 | #endif |