Stefan Kiegerl
/
run_test
run test
main.cpp@1:f92ffd7d6a00, 2020-01-13 (annotated)
- Committer:
- stkiegerl
- Date:
- Mon Jan 13 17:20:54 2020 +0000
- Revision:
- 1:f92ffd7d6a00
- Parent:
- 0:c9cfffb3a319
- Child:
- 2:da59c940bc1b
added nibbleLeds() Function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stkiegerl | 0:c9cfffb3a319 | 1 | #include "mbed.h" |
stkiegerl | 1:f92ffd7d6a00 | 2 | #define BUTTON1 p14 // M3: push joystick pin |
stkiegerl | 1:f92ffd7d6a00 | 3 | #define BUTTON1 A1 // NUCLEO: Taster A1 |
stkiegerl | 1:f92ffd7d6a00 | 4 | |
stkiegerl | 1:f92ffd7d6a00 | 5 | void nibbleLeds(int value); |
stkiegerl | 0:c9cfffb3a319 | 6 | |
stkiegerl | 0:c9cfffb3a319 | 7 | BusOut myleds(LED1, LED2, LED3, LED4); |
stkiegerl | 0:c9cfffb3a319 | 8 | DigitalIn button(BUTTON1); |
stkiegerl | 0:c9cfffb3a319 | 9 | |
stkiegerl | 0:c9cfffb3a319 | 10 | const int INIT = 0x03; |
stkiegerl | 0:c9cfffb3a319 | 11 | |
stkiegerl | 0:c9cfffb3a319 | 12 | int main () { |
stkiegerl | 1:f92ffd7d6a00 | 13 | int anzahl, anz; |
stkiegerl | 1:f92ffd7d6a00 | 14 | uint8_t value = INIT; |
stkiegerl | 1:f92ffd7d6a00 | 15 | |
stkiegerl | 1:f92ffd7d6a00 | 16 | nibbleLeds(value); |
stkiegerl | 1:f92ffd7d6a00 | 17 | wait(0.1); |
stkiegerl | 1:f92ffd7d6a00 | 18 | } |
stkiegerl | 1:f92ffd7d6a00 | 19 | |
stkiegerl | 1:f92ffd7d6a00 | 20 | void nibbleLeds(int value){ |
stkiegerl | 1:f92ffd7d6a00 | 21 | myleds = value%16; |
stkiegerl | 0:c9cfffb3a319 | 22 | } |