Mirza Mesic
/
tinf_test_mesic_mirza
mainfunktion1
main.cpp@1:b9fbf5790ee0, 2020-01-13 (annotated)
- Committer:
- mirzamesic
- Date:
- Mon Jan 13 17:20:00 2020 +0000
- Revision:
- 1:b9fbf5790ee0
- Parent:
- 0:2263bfee9a45
nibbleLeds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mirzamesic | 0:2263bfee9a45 | 1 | #include "mbed.h" |
mirzamesic | 0:2263bfee9a45 | 2 | #define BUTTON1 p14 |
mirzamesic | 0:2263bfee9a45 | 3 | |
mirzamesic | 1:b9fbf5790ee0 | 4 | void nibbleLeds(int value); |
mirzamesic | 1:b9fbf5790ee0 | 5 | |
mirzamesic | 0:2263bfee9a45 | 6 | BusOut myleds(LED1,LED2,LED3,LED4); |
mirzamesic | 0:2263bfee9a45 | 7 | DigitalIn button(BUTTON1); |
mirzamesic | 0:2263bfee9a45 | 8 | |
mirzamesic | 1:b9fbf5790ee0 | 9 | const int INIT = 0x03; |
mirzamesic | 1:b9fbf5790ee0 | 10 | |
mirzamesic | 0:2263bfee9a45 | 11 | int main() |
mirzamesic | 0:2263bfee9a45 | 12 | { |
mirzamesic | 1:b9fbf5790ee0 | 13 | |
mirzamesic | 1:b9fbf5790ee0 | 14 | uint8_t value = INIT; |
mirzamesic | 0:2263bfee9a45 | 15 | |
mirzamesic | 1:b9fbf5790ee0 | 16 | nibbleLeds(value); |
mirzamesic | 1:b9fbf5790ee0 | 17 | wait(0.1); |
mirzamesic | 1:b9fbf5790ee0 | 18 | } |
mirzamesic | 0:2263bfee9a45 | 19 | |
mirzamesic | 0:2263bfee9a45 | 20 | |
mirzamesic | 1:b9fbf5790ee0 | 21 | void nibbleLeds (int value) |
mirzamesic | 1:b9fbf5790ee0 | 22 | { |
mirzamesic | 0:2263bfee9a45 | 23 | |
mirzamesic | 1:b9fbf5790ee0 | 24 | myleds = value%16; |
mirzamesic | 1:b9fbf5790ee0 | 25 | |
mirzamesic | 1:b9fbf5790ee0 | 26 | } |