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