Mario Barisic
/
test_program
test program
main.cpp@0:dfb1326f7f80, 2020-01-13 (annotated)
- Committer:
- shogu
- Date:
- Mon Jan 13 17:24:19 2020 +0000
- Revision:
- 0:dfb1326f7f80
- Child:
- 1:899bf4117ea9
nur_main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shogu | 0:dfb1326f7f80 | 1 | #include "mbed.h" |
shogu | 0:dfb1326f7f80 | 2 | #define BUTTON1 p14 // M3: push joystick pin |
shogu | 0:dfb1326f7f80 | 3 | // #define BUTTON1 A1 //NUCLEO: Taster A1 |
shogu | 0:dfb1326f7f80 | 4 | |
shogu | 0:dfb1326f7f80 | 5 | |
shogu | 0:dfb1326f7f80 | 6 | BusOut myleds(LED1, LED2, LED3, LED4); |
shogu | 0:dfb1326f7f80 | 7 | DigitalIn button(BUTTON1); |
shogu | 0:dfb1326f7f80 | 8 | |
shogu | 0:dfb1326f7f80 | 9 | const int INIT = 0x03; |
shogu | 0:dfb1326f7f80 | 10 | |
shogu | 0:dfb1326f7f80 | 11 | int main() { |
shogu | 0:dfb1326f7f80 | 12 | while(1) { |
shogu | 0:dfb1326f7f80 | 13 | myleds = 0x05; |
shogu | 0:dfb1326f7f80 | 14 | if(button) |
shogu | 0:dfb1326f7f80 | 15 | myleds = 0x0A; |
shogu | 0:dfb1326f7f80 | 16 | wait(0.1); |
shogu | 0:dfb1326f7f80 | 17 | } |
shogu | 0:dfb1326f7f80 | 18 | } |