Mumin Hadzic
/
TINF_TestProgramm
Main
main.cpp@0:4c39745fe0c2, 2020-01-13 (annotated)
- Committer:
- muminhadzic
- Date:
- Mon Jan 13 17:14:46 2020 +0000
- Revision:
- 0:4c39745fe0c2
- Child:
- 1:2513045fcb59
1. Main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
muminhadzic | 0:4c39745fe0c2 | 1 | #include "mbed.h" |
muminhadzic | 0:4c39745fe0c2 | 2 | #define BUTTON1 p14 |
muminhadzic | 0:4c39745fe0c2 | 3 | //#define BUTTON1 A1 |
muminhadzic | 0:4c39745fe0c2 | 4 | |
muminhadzic | 0:4c39745fe0c2 | 5 | //int modifyBit(int x, unsigned char position, bool State); |
muminhadzic | 0:4c39745fe0c2 | 6 | //int lauflicht(bool richtung,int time, int &anz); |
muminhadzic | 0:4c39745fe0c2 | 7 | //void nibbleLeds(int value); |
muminhadzic | 0:4c39745fe0c2 | 8 | //void printb(uint8_t x); |
muminhadzic | 0:4c39745fe0c2 | 9 | |
muminhadzic | 0:4c39745fe0c2 | 10 | BusOut myleds(LED1,LED2,LED3,LED4); |
muminhadzic | 0:4c39745fe0c2 | 11 | DigitalIn button(BUTTON1); |
muminhadzic | 0:4c39745fe0c2 | 12 | |
muminhadzic | 0:4c39745fe0c2 | 13 | const int INIT = 0x03; |
muminhadzic | 0:4c39745fe0c2 | 14 | |
muminhadzic | 0:4c39745fe0c2 | 15 | |
muminhadzic | 0:4c39745fe0c2 | 16 | int main() { |
muminhadzic | 0:4c39745fe0c2 | 17 | while(1){ |
muminhadzic | 0:4c39745fe0c2 | 18 | myleds=0x05; |
muminhadzic | 0:4c39745fe0c2 | 19 | if(button) |
muminhadzic | 0:4c39745fe0c2 | 20 | myleds=0x0A; |
muminhadzic | 0:4c39745fe0c2 | 21 | wait(0.1); |
muminhadzic | 0:4c39745fe0c2 | 22 | } |
muminhadzic | 0:4c39745fe0c2 | 23 | |
muminhadzic | 0:4c39745fe0c2 | 24 | } |
muminhadzic | 0:4c39745fe0c2 | 25 |