Maida Ahmic
/
LaufTest
test programm
main.cpp@0:1988d79fc609, 2020-01-13 (annotated)
- Committer:
- adiam
- Date:
- Mon Jan 13 17:28:30 2020 +0000
- Revision:
- 0:1988d79fc609
- Child:
- 1:54883b2b3a1f
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adiam | 0:1988d79fc609 | 1 | #include "mbed.h" |
adiam | 0:1988d79fc609 | 2 | |
adiam | 0:1988d79fc609 | 3 | #define BUTTON1 P14 // M3:push joystick pin |
adiam | 0:1988d79fc609 | 4 | #define BUTTON1 A1 //NUCLEO:Taster A1 |
adiam | 0:1988d79fc609 | 5 | |
adiam | 0:1988d79fc609 | 6 | //int modifyBit(int x,unsigned char position,bool State); |
adiam | 0:1988d79fc609 | 7 | //int lauflicht(bool richtung,int time,int &anz); |
adiam | 0:1988d79fc609 | 8 | //void nibbleLeds(int value); |
adiam | 0:1988d79fc609 | 9 | //void printb(uint8_t x); |
adiam | 0:1988d79fc609 | 10 | |
adiam | 0:1988d79fc609 | 11 | BusOut myleds(LED1,LED2,LED3,LED4); |
adiam | 0:1988d79fc609 | 12 | DigitalIn button(BUTTON1); |
adiam | 0:1988d79fc609 | 13 | |
adiam | 0:1988d79fc609 | 14 | const int INIT=0x03; |
adiam | 0:1988d79fc609 | 15 | |
adiam | 0:1988d79fc609 | 16 | int main() { |
adiam | 0:1988d79fc609 | 17 | while(1) { |
adiam | 0:1988d79fc609 | 18 | myleds=0x05; |
adiam | 0:1988d79fc609 | 19 | if(button) |
adiam | 0:1988d79fc609 | 20 | myleds=0x0A; |
adiam | 0:1988d79fc609 | 21 | wait(0.1); |
adiam | 0:1988d79fc609 | 22 | } |
adiam | 0:1988d79fc609 | 23 | } |
adiam | 0:1988d79fc609 | 24 |