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.
Fork of Motor by
Moteur.cpp
00001 #include "Moteur.h" 00002 00003 #include "mbed.h" 00004 00005 Moteur::Moteur(PinName pwm, PinName avancer, PinName reculer): _pwm(pwm), _avancer(avancer), _reculer(reculer) { 00006 00007 // Set initial condition of PWM 00008 _pwm.period(0.001); 00009 _pwm = 0; 00010 00011 // Initial condition of output enables 00012 _avancer = 0; 00013 _reculer = 0; 00014 } 00015 00016 void Moteur::vitesse(float vit) { 00017 00018 _avancer = (vit> 0.0); 00019 _reculer = (vit < 0.0); 00020 _pwm = abs(vit); 00021 } 00022 00023 00024
Generated on Sun Jul 17 2022 00:03:12 by
1.7.2
