Leds work simultanously. Version 3.1
Dependents: bertl_led bertl_led bertl_led bertl_led ... more
Fork of Bertl by
BULME HTL Graz-Gösting
FSST - Hardwarenahe Programmierung
Created by Prof.Dr. Franz Pucher
Inhalt
Start mit folgendem Code in main.cpp eines neuen Projektes mbed_blinky:
#include "mbed.h" #include "const.h" #include "Robot.h" Robot bertl; int main() { bertl.NibbleLeds(0x0F); wait(1); bertl.NibbleLeds(0x00); while(1) { if(bertl.IsButtonPressed(BTN_BL)) { bertl.TurnLedOn(LED_BL1); } if(bertl.IsButtonPressed(BTN_BR)) { bertl.TurnLedOff(LED_BL1); } } }
Diff: const.h
- Revision:
- 17:308802267a62
- Parent:
- 15:43d6a7e6e64a
- Child:
- 18:e9bb4513ae3a
diff -r 9ec833d98d0d -r 308802267a62 const.h --- a/const.h Thu Nov 12 09:05:05 2015 +0000 +++ b/const.h Thu Nov 12 19:05:56 2015 +0000 @@ -31,14 +31,14 @@ \warning maybe the number has to be adjusted */ const int ANGLE = 12; /* nearly 90 degree turn left */ -const int BTN_FLL = 0x80; // button front left outer -const int BTN_FL = 0x04; // button front left -const int BTN_FM = 0x01; // button front middle -const int BTN_FR = 0x08; // button front right -const int BTN_FRR = 0x40; // button front right outer -const int BTN_BL = 0x10; // button back left -const int BTN_BM = 0x02; // button back middle -const int BTN_BR = 0x20; // button back right +const int BTN_FLL = 0x80; /**< button front left outer */ +const int BTN_FL = 0x04; /**< button front left */ +const int BTN_FM = 0x01; /**< button front middle*/ +const int BTN_FR = 0x08; /**< button front right */ +const int BTN_FRR = 0x40; /**< button front right outer*/ +const int BTN_BL = 0x10; /**< button back left*/ +const int BTN_BM = 0x02; /**< button back middle*/ +const int BTN_BR = 0x20; /**< button back right*/ const int LED_FL1 = 0x01; /**< front LED white */ const int LED_FL2 = 0x02; /**< front LED yellow */