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 4DGL-uLCD-SE MMA8452
inputs/inputs.h@4:fb7d49e660f2, 2019-03-16 (annotated)
- Committer:
- Yehowshua
- Date:
- Sat Mar 16 05:25:19 2019 +0000
- Revision:
- 4:fb7d49e660f2
- Parent:
- 3:0e14def93d4e
now with inputs
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Yehowshua Immanuel |
3:0e14def93d4e | 1 | #pragma once |
| Yehowshua | 4:fb7d49e660f2 | 2 | #include "MMA8452.h" |
| Yehowshua | 4:fb7d49e660f2 | 3 | #include "mbed.h" |
| Yehowshua | 4:fb7d49e660f2 | 4 | |
| Yehowshua | 4:fb7d49e660f2 | 5 | #define NO_ACTION 0 |
| Yehowshua | 4:fb7d49e660f2 | 6 | #define ACTION_BUTTON 1 |
| Yehowshua | 4:fb7d49e660f2 | 7 | #define BOMB_BUTTON 2 |
| Yehowshua | 4:fb7d49e660f2 | 8 | #define GO_LEFT 3 |
| Yehowshua | 4:fb7d49e660f2 | 9 | #define GO_RIGHT 4 |
| Yehowshua | 4:fb7d49e660f2 | 10 | #define GO_UP 5 |
| Yehowshua | 4:fb7d49e660f2 | 11 | #define GO_DOWN 6 |
| Yehowshua Immanuel |
3:0e14def93d4e | 12 | |
| Yehowshua Immanuel |
3:0e14def93d4e | 13 | typedef struct{ |
| Yehowshua Immanuel |
3:0e14def93d4e | 14 | //buttons |
| Yehowshua Immanuel |
3:0e14def93d4e | 15 | char b1, b2, b3; |
| Yehowshua Immanuel |
3:0e14def93d4e | 16 | |
| Yehowshua Immanuel |
3:0e14def93d4e | 17 | //accelerometer |
| Yehowshua | 4:fb7d49e660f2 | 18 | double a_x, a_y, a_z; |
| Yehowshua Immanuel |
3:0e14def93d4e | 19 | |
| Yehowshua Immanuel |
3:0e14def93d4e | 20 | //implement more inputs here if needed |
| Yehowshua | 4:fb7d49e660f2 | 21 | }inputs; |
| Yehowshua | 4:fb7d49e660f2 | 22 | |
| Yehowshua | 4:fb7d49e660f2 | 23 | extern "C" { |
| Yehowshua | 4:fb7d49e660f2 | 24 | int get_inputs(void); |
| Yehowshua | 4:fb7d49e660f2 | 25 | } |
| Yehowshua | 4:fb7d49e660f2 | 26 | |
| Yehowshua | 4:fb7d49e660f2 | 27 | extern "C" { |
| Yehowshua | 4:fb7d49e660f2 | 28 | void inputs_init(void); |
| Yehowshua | 4:fb7d49e660f2 | 29 | } |