![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Teacher version
Dependencies: mbed lib_workshop_2019
src/test_motor/test_motor.cpp
- Committer:
- gvaquette
- Date:
- 2019-10-24
- Revision:
- 5:d99659a45cab
- Parent:
- 4:bf5caf4c0c88
File content as of revision 5:d99659a45cab:
#include "mbed.h" #include "test_motor.h" #include "console_output.h" void ft_test_motor(PwmOut pin_pwm_mot, DigitalOut pin_dirA, DigitalOut pin_dirB, Serial &pc) { e_direction direction = FORWARD; int user_int=1; double duty_cycle =0.1; do{ if (pc.readable() ) { user_int = ft_get_user_int(pc); if (user_int < 10 && user_int >= 0) duty_cycle = user_int/10.0; } ft_run_motor(direction, duty_cycle, pin_pwm_mot, pin_dirA, pin_dirB); } while (user_int > 0); return; }