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.
main.cpp
00001 #include "mbed.h" 00002 #include "QEI.h" 00003 #include "Motor.h" 00004 00005 Serial pc(USBTX, USBRX); 00006 QEI Encoder(p29 ,p30, NC, 48); 00007 Motor Wheel(p23, p21, p22); 00008 00009 int main() { 00010 float MotorOutput = 0; 00011 Encoder.reset(); 00012 while (1) { 00013 pc.scanf("%f", &MotorOutput); 00014 float NoPulses = Encoder.getPulses(); 00015 00016 float Percentage = (NoPulses / 48) * 100; 00017 pc.printf("%f\n", Percentage); 00018 00019 Wheel.speed((MotorOutput - 50) * 2 / 100); 00020 00021 wait(0.005); 00022 } 00023 }
Generated on Tue Jul 12 2022 11:13:38 by
