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:
- 18:e9bb4513ae3a
- Parent:
- 17:308802267a62
diff -r 308802267a62 -r e9bb4513ae3a const.h --- a/const.h Thu Nov 12 19:05:56 2015 +0000 +++ b/const.h Fri Feb 19 15:28:42 2016 +0000 @@ -1,6 +1,6 @@ /*! \file const.h \brief A Documented file. -* name: const.h Version: 3.0 \n +* name: const.h Version: 3.2 \n * author: PE HTL BULME \n * email: pe@bulme.at \n * description: @@ -11,17 +11,17 @@ #define CONST_H #define TIME /**< if defined Bertl uses the time and not motor encoder*/ const int MOVE=500; /**< ms move forward or backward */ -const int TURN=500; /**< ms TurnLeft or TurnRigth (nearly 90 degree) */ -const int STEPTIME=20; /**< ms turn left or right for adjusting moves for TurnLeft or TurnRigth */ +const int TURN=500; /**< ms TurnLeft or TurnRight (nearly 90 degree) */ +const int STEPTIME=20; /**< ms turn left or right for adjusting moves for TurnLeft or TurnRight */ /*! \var int ULTRASONIC_DISTANCE \brief Bertl Ultrasonic Distance Sensor from 1 to n; 5 is ok for nearly 5 cm. \warning no warning*/ -const int ULTRASONIC_DISTANCE = 5; /* Distance sensor */ +const int ULTRASONIC_DISTANCE = 6; /* Distance sensor */ /*! \var int SPEED \brief Bertl speed 0.2 (slow) - 1.0 (fast). \warning speed below 0.2 possible the motor won't start */ -const float SPEED = 0.4; /* Bertl speed 0.2 (slow) - 1.0 (fast) */ +const float SPEED = 0.1; /* Bertl speed 0.2 (slow) - 1.0 (fast) */ /*! \var int DISTANCE \brief one wheel turn is appr. 24 ticks. \warning maybe the number has to be adjusted */