Porn

Dependencies:   HCSR04 mbed tsi_sensor

Fork of frdm_tsi_slider by kasper røgen

Files at this revision

API Documentation at this revision

Comitter:
Risifutti
Date:
Sat Apr 11 09:51:14 2015 +0000
Parent:
0:5e7a5b5b6922
Commit message:
NO1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5e7a5b5b6922 -r 06bd2e196518 main.cpp
--- a/main.cpp	Sat Apr 11 08:57:27 2015 +0000
+++ b/main.cpp	Sat Apr 11 09:51:14 2015 +0000
@@ -102,6 +102,7 @@
 void motorControl(char input) {
   switch (input) {
     case 'w':
+    sideSpeed = 0;
     BT.printf("FORWARDS!");
       if (frontSpeed < 0.99) {
         frontSpeed = frontSpeed + 0.25f;
@@ -116,6 +117,7 @@
       break;
 
     case 's':
+    sideSpeed = 0;
     if (frontSpeed > 0.1) {
         frontSpeed = frontSpeed - 0.25f;
       }
@@ -130,10 +132,10 @@
 
     case 'a':
       if (leftSpeed > 0.1) {
-        leftSpeed = leftSpeed - 0.25f;
+        leftSpeed = leftSpeed - 0.10f;
       }
       if (rightSpeed < 0.99) {
-        rightSpeed = rightSpeed + 0.25f;
+        rightSpeed = rightSpeed + 0.10f;
       }
       leftForward = rightSpeed;
       leftBackward = leftSpeed;
@@ -143,10 +145,10 @@
 
     case 'd':
       if (leftSpeed < 0.99) {
-        leftSpeed = leftSpeed + 0.25f;
+        leftSpeed = leftSpeed + 0.10f;
       }
       if (rightSpeed > 0.1) {
-        rightSpeed = rightSpeed - 0.25f;
+        rightSpeed = rightSpeed - 0.10f;
       }
       leftForward = rightSpeed;
       leftBackward = leftSpeed;
@@ -198,6 +200,7 @@
       heightUp = 0;
       heightDown = 0;
       break;
+      /*
     case 'p':
         if(pilot == false){
             pilot = true;
@@ -206,6 +209,7 @@
             }
         }
     break;
+    */
   }
 }
 int main(void) {