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: ExperimentServer QEI_pmw MotorShield
Diff: main.cpp
- Revision:
- 8:98a83981c238
- Parent:
- 6:1faceb53dabe
- Child:
- 9:97360c92666f
--- a/main.cpp Mon Aug 24 20:20:50 2020 +0000
+++ b/main.cpp Tue Aug 25 23:38:34 2020 +0000
@@ -4,6 +4,7 @@
#include "ExperimentServer.h"
#include "QEI.h"
#include "MotorShield.h"
+#include "HardwareSetup.h"
#define NUM_INPUTS 2
#define NUM_OUTPUTS 3
@@ -22,20 +23,22 @@
AnalogIn currentC(PF_13); //MOTOR C CURRENT SENSOR
AnalogIn currentD(PA_4); //MOTOR D CURRENT SENSOR
-MotorShield motorA(PE_5, PE_6); //MOTOR A PWM
-MotorShield motorB(PB_14, PB_15); //MOTOR B PWM
-MotorShield motorC(PA_6, PF_9); //MOTOR C PWM
-MotorShield motorD(PF_6, PF_7); //MOTOR D PWM
-
-//deprecate the following
-PwmOut motorPWM(D5); // Motor PWM output
-DigitalOut motorFwd(D6); // Motor forward enable
-DigitalOut motorRev(D7); // Motor backward enable
-
-
+//MotorShield motorA(PE_5, PE_6); //MOTOR A PWM
+//MotorShield motorB(PB_14, PB_15); //MOTOR B PWM
+//MotorShield motorC(PA_6, PF_9); //MOTOR C PWM
+//MotorShield motorD(PF_6, PF_7); //MOTOR D PWM
int main (void)
{
+ initHardware(); // Setup PWM
+ wait_us(100);
+
+ TIM12->CCR2 = 100;
+ TIM12->CCR1 = 200;
+
+ while(1){
+ }
+ /*
// Link the terminal with our server and start it up
server.attachTerminal(pc);
server.init();
@@ -86,5 +89,6 @@
motorPWM.write(0);
} // end if
} // end while
+ */
} // end main