![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Geschwindigkeitesregelung durch den Ultraschallsensor
Dependencies: BertlLib bertl_libraries mbed
main.cpp
- Committer:
- TFuchsbichler
- Date:
- 2016-04-25
- Revision:
- 0:9ff985002d48
File content as of revision 0:9ff985002d48:
#include "mbed.h" #include "Bertl14.h" #include "BertlObjects.h" #include "class_hardware.h" #include "pins_bertl.h" BusOut boardPow(PW_MOT, PW_IR, PW_ENC); Motor m_right(MR_PWM, MR_FWD, MR_REV); Motor m_left(ML_PWM, ML_FWD, ML_REV); USSensor usens(US_T,US_E); int main() { boardPow=3; InitBertl(); pex.useISR=0; leds=9; pex.ClearLeds(); pex.WaitUntilButtonPressed(); pex.WaitUntilButtonPressed(); usens.initialize(); while(1) { int speed = ( usens.distance_mm - 80 ) * 1; m_left.set(speed); m_right.set(speed); } }