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: ur_Bertl.cpp
- Revision:
- 18:e9bb4513ae3a
- Parent:
- 17:308802267a62
diff -r 308802267a62 -r e9bb4513ae3a ur_Bertl.cpp --- a/ur_Bertl.cpp Thu Nov 12 19:05:56 2015 +0000 +++ b/ur_Bertl.cpp Fri Feb 19 15:28:42 2016 +0000 @@ -1,5 +1,5 @@ /*********************************** -name: ur_Bertl.cpp Version: 3.0 +name: ur_Bertl.cpp Version: 3.2 class Bertl included author: PE HTL BULME email: pe@bulme.at @@ -437,7 +437,7 @@ return _count - count; } -void Bertl::TurnRigth() +void Bertl::TurnRight() { int count = _count; MotorR_EN=MotorL_EN=1; // motor left and right ENABLE @@ -462,7 +462,7 @@ wait_ms(250); // only to step the robot } // ------------------------- to adjust turns --------------------------------- -void Bertl::TurnRigthStep(int step) +void Bertl::TurnRightStep(int step) { int count = _count; MotorR_EN=MotorL_EN=1; // motor left and right ENABLE @@ -518,6 +518,14 @@ detect = linesensor; return detect; } +// Bertl15: 5 sensors are available +uint8_t Bertl::GetLineValues5() +{ + uint8_t detect; + + detect = linesensor5; + return detect; +} void Bertl::RGBLed(bool red, bool green, bool blue) {