![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Tutorial for first mbed project
Dependencies: mbed lib_workshop_2019
Diff: src/test_motor/test_motor.cpp
- Revision:
- 9:19255172362f
- Parent:
- 8:c2d06715025f
--- a/src/test_motor/test_motor.cpp Thu Oct 24 06:06:55 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#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; -} \ No newline at end of file