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: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: motorAndSensorControl.cpp
- Revision:
- 32:da34d27a13f3
- Parent:
- 31:d1bd16a05148
- Child:
- 33:5e2e95c322da
- Child:
- 34:b035131eda3e
diff -r d1bd16a05148 -r da34d27a13f3 motorAndSensorControl.cpp --- a/motorAndSensorControl.cpp Wed Oct 09 13:50:32 2019 +0000 +++ b/motorAndSensorControl.cpp Wed Oct 09 14:19:23 2019 +0000 @@ -5,6 +5,7 @@ #include "mbed.h" #include "FastPWM.h" #include "QEI.h" +#include "global.h" //Objects //Motors @@ -28,8 +29,9 @@ const double PI = 3.14159265358979; const float countsToRadians = (2*PI)/uniqueMeasurementPoints; //Number of radians per count + -motorReturn motorAndEncoder(float PWM1, float PWM2, float dt) +void motorAndEncoder(float PWM1, float PWM2, float dt) { //Set motors //Direction @@ -81,6 +83,4 @@ motorReturn.motor1.velocity = velocityMotor1; motorReturn.motor2.velocity = velocityMotor2; - - return motorReturn }