![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Signa-bot code for project BioRobotics, at University of Twente.
Dependencies: mbed QEI MODSERIAL FastPWM ttmath Math
Motor_tryout.cpp
- Committer:
- Feike
- Date:
- 2019-09-30
- Revision:
- 7:e119b12e5e7f
- Parent:
- 4:bd21569250c7
- Child:
- 8:017b813c72bb
File content as of revision 7:e119b12e5e7f:
#include "mbed.h" //#include "MODSERIAL.h" // test DigitalOut motor1_pwm(PTA2); //MODSERIAL pc(USBTX, USBRX); int main(void) { int frequency_pwm = 10000; //10 kHz PWM PwmOut motor1_pwm(PTA2); motor1_pwm.period(1.0/(double)frequency_pwm); // T=1/f while(true) { for(int pct = 0 ; pct <= 100 ; pct += 10) { motor1_pwm.write(pct/100.0); // write Duty Cycle wait(1.0f); } } }