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.
Diff: main.cpp
- Revision:
- 35:5857105c9956
- Parent:
- 34:599634375ba0
- Parent:
- 30:e60fd3834ee7
- Child:
- 36:747d80e3aca9
diff -r 599634375ba0 -r 5857105c9956 main.cpp
--- a/main.cpp Thu Mar 16 21:38:57 2017 +0000
+++ b/main.cpp Thu Mar 16 21:49:07 2017 +0000
@@ -19,20 +19,6 @@
volatile float accError = 0;
volatile float prevError = 0;
-float getDuty(float w){
- for (int i = 0; i < 28; i++) { //iterate through the angular velocities
- if (w >= angularVelocities[i] && w <= angularVelocities[i+1]) {
- if (w-angularVelocities[i] < angularVelocities[i+1]-w ) {
- return dutyCycles[i];
- }
- else {
- return dutyCycles[i+1];
- }
- }
- }
- return dutyCycles[28];
-}
-
#define kp 0.0016f
#define ki 0.0f //0.05f
#define kd 0.00006f //0.5f
@@ -82,7 +68,7 @@
motorHome(); //Initialise motor before any interrupt
dt_I3.start(); //Start the time counters for velocity
-
+
controlTicker.attach(&control, dt);
I1.rise(&i_edge); //Assign interrupt handlers for LEDs
