FTKL USER
/
LaufTest
Testprogramm Lauflicht
main.cpp@1:08ec8244e7d1, 2020-01-13 (annotated)
- Committer:
- ftkl_user
- Date:
- Mon Jan 13 17:05:16 2020 +0000
- Revision:
- 1:08ec8244e7d1
- Parent:
- 0:4e4afa4ac3d9
- Child:
- 2:315300eaee39
func nibbleLed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ftkl_user | 0:4e4afa4ac3d9 | 1 | #include "mbed.h" |
ftkl_user | 1:08ec8244e7d1 | 2 | #define BUTTON1 p14 // M3: push joystick pin |
ftkl_user | 0:4e4afa4ac3d9 | 3 | //#define BUTTON1 A1 // NUCLEO: Taster A1 |
ftkl_user | 0:4e4afa4ac3d9 | 4 | |
ftkl_user | 1:08ec8244e7d1 | 5 | void nibbleLeds(int value); |
ftkl_user | 1:08ec8244e7d1 | 6 | |
ftkl_user | 0:4e4afa4ac3d9 | 7 | BusOut myleds(LED1, LED2, LED3, LED4); |
ftkl_user | 0:4e4afa4ac3d9 | 8 | DigitalIn button(BUTTON1); |
ftkl_user | 0:4e4afa4ac3d9 | 9 | |
ftkl_user | 0:4e4afa4ac3d9 | 10 | const int INIT = 0x03; |
ftkl_user | 0:4e4afa4ac3d9 | 11 | |
ftkl_user | 0:4e4afa4ac3d9 | 12 | int main() { |
ftkl_user | 1:08ec8244e7d1 | 13 | int anzahl, anz; |
ftkl_user | 1:08ec8244e7d1 | 14 | uint8_t value = INIT; |
ftkl_user | 1:08ec8244e7d1 | 15 | |
ftkl_user | 1:08ec8244e7d1 | 16 | nibbleLeds(value); |
ftkl_user | 1:08ec8244e7d1 | 17 | wait(0.1); |
ftkl_user | 0:4e4afa4ac3d9 | 18 | } |
ftkl_user | 1:08ec8244e7d1 | 19 | |
ftkl_user | 1:08ec8244e7d1 | 20 | void nibbleLeds(int value) { |
ftkl_user | 1:08ec8244e7d1 | 21 | myleds = value%16; |
ftkl_user | 1:08ec8244e7d1 | 22 | } |