Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HBridgeDCMotor RateLimiter mbed
main.cpp
00001 #include "mbed.h" 00002 #include "HBridgeDCMotor.h" 00003 00004 HBridgeDCMotor m1(PTC10, PTC11); 00005 HBridgeDCMotor m2(D6, D7); 00006 00007 int main() { 00008 float sampleTime = 50e-3, switchingFrequency = 25e3, rampTime = 3; 00009 m1.configure(sampleTime, switchingFrequency, rampTime, rampTime); 00010 m2.configure(sampleTime, switchingFrequency, rampTime, rampTime); 00011 while(true) { 00012 m1.setDutyCycle(1); 00013 m2.setDutyCycle(1); 00014 wait(10); 00015 m1.setDutyCycle(-1); 00016 m2.setDutyCycle(-1); 00017 wait(10); 00018 } 00019 }
Generated on Sat Jul 16 2022 23:19:43 by
1.7.2