first commit

Dependencies:   mbed MMA8451Q

Revision:
14:eb9c58c0f8cd
Parent:
13:0091da3021df
Child:
15:32a4440ad305
--- a/driving.h	Tue Oct 26 14:07:48 2021 +0000
+++ b/driving.h	Tue Oct 26 16:33:42 2021 +0000
@@ -78,6 +78,8 @@
 volatile bool motor_enabled = false;
 void PI(void) { //motor PI interrupt
     if(motor_enabled == true) {
+         setpointLeft = 0.2;
+         setpointRight = 0.2;
         //--- Calculate Error ---
         errorLeft = setpointLeft - (speedLeftVolt / 3.3f); //error and setpoint is defined as a percentage, from 0 to 1
         errorRight = setpointRight - (speedRightVolt / 3.3f);
@@ -164,8 +166,8 @@
             }
             
             //--- set motors to calculated output ---    
-            motorLeft.write(dutyCycleLeft);
-            motorRight.write(dutyCycleRight);
+            motorLeft.write(0.2);
+            motorRight.write(0.2);
             
 //--- motor braking ---
 /*