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:
- 8:07e55b300ff1
- Parent:
- 6:df6830254e8b
- Child:
- 9:fc3a7ad346e6
diff -r e7f74f072564 -r 07e55b300ff1 const.h --- a/const.h Mon Apr 13 15:28:10 2015 +0000 +++ b/const.h Fri Apr 17 06:59:34 2015 +0000 @@ -1,10 +1,11 @@ /*! \file const.h \brief A Documented file. -* name: const.h Version: 1.0 \n +* name: const.h Version: 2.0 \n * author: PE HTL BULME \n * email: pe@bulme.at \n * description: -* Constants for ur_Bertl The Robot +* Constants for ur_Bertl The Robot +* Constant for Robot from objectiv Robot added */ #ifndef CONST_H #define CONST_H @@ -56,6 +57,10 @@ const int addr = 0x40; // I2C-address PCA9555 const int PERIOD = 20; // PWM period const int PULSWIDTH = 5; // PWN pulswidth +const int East = 1; +const int West = 2; +const int North = 3; +const int South = 4; #endif \ No newline at end of file