Motor class working
Dependencies: QEI biquadFilter mbed
main.cpp
- Committer:
- Alex_Kyrl
- Date:
- 2017-10-16
- Revision:
- 3:9d861827b714
- Parent:
- 1:1a01edf0379c
File content as of revision 3:9d861827b714:
#include "Motor.h" Ticker tick; Ticker tack; DigitalIn a(D2); DigitalIn b(D3); Motor motor; void ticker() { motor.Motor::set_angle(); motor.Motor::set_velocity(); } void tock(){ if(a==0){ motor.control_velocity(0.8);} else{ motor.control_velocity(0);} if(b==0){ motor.change_direction();} } int main() { tack.attach(&tock, 0.2); tick.attach(&ticker, 0.01); }