Mario Barisic
/
test_program
test program
main.cpp@1:899bf4117ea9, 2020-01-13 (annotated)
- Committer:
- shogu
- Date:
- Mon Jan 13 17:30:06 2020 +0000
- Revision:
- 1:899bf4117ea9
- Parent:
- 0:dfb1326f7f80
- Child:
- 2:3875bc678188
mit_nibble
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 | 1:899bf4117ea9 | 5 | void nibbleLeds(int value); |
shogu | 0:dfb1326f7f80 | 6 | |
shogu | 0:dfb1326f7f80 | 7 | BusOut myleds(LED1, LED2, LED3, LED4); |
shogu | 0:dfb1326f7f80 | 8 | DigitalIn button(BUTTON1); |
shogu | 0:dfb1326f7f80 | 9 | |
shogu | 0:dfb1326f7f80 | 10 | const int INIT = 0x03; |
shogu | 0:dfb1326f7f80 | 11 | |
shogu | 0:dfb1326f7f80 | 12 | int main() { |
shogu | 1:899bf4117ea9 | 13 | int anzahl, anz; |
shogu | 1:899bf4117ea9 | 14 | uint8_t value = INIT; |
shogu | 1:899bf4117ea9 | 15 | |
shogu | 1:899bf4117ea9 | 16 | nibbleLeds(value); |
shogu | 1:899bf4117ea9 | 17 | wait(0.1); |
shogu | 0:dfb1326f7f80 | 18 | } |
shogu | 1:899bf4117ea9 | 19 | |
shogu | 1:899bf4117ea9 | 20 | |
shogu | 1:899bf4117ea9 | 21 | void nibbleLeds(int value) { |
shogu | 1:899bf4117ea9 | 22 | myleds = value%16; |
shogu | 1:899bf4117ea9 | 23 | } |