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:
- 1:fafbac0ba96d
- Parent:
- 0:66e9a0afcbd6
- Child:
- 2:1cd559ff516b
diff -r 66e9a0afcbd6 -r fafbac0ba96d const.h --- a/const.h Thu Feb 26 10:12:06 2015 +0000 +++ b/const.h Thu Mar 19 19:12:33 2015 +0000 @@ -44,6 +44,8 @@ const int LED_ALL_BACK = 0xF0; const int LED_ALL = 0xFF; +const int LED_BLUE = 0xBB; + const int addr = 0x40; // I2C-address PCA9555 const int PERIOD = 20; // PWM period const int PULSWIDTH = 5; // PWN pulswidth