Agra-GPS / FreePilot_V2-3

Dependencies:   FreePilot PinDetect mbed-src

Fork of FreePilot_V2-2 by Agra-GPS

Revision:
44:e9d5cd98273d
Parent:
43:e3f064f5eecd
Child:
45:ecd8c2e27948
diff -r e3f064f5eecd -r e9d5cd98273d main.cpp
--- a/main.cpp	Mon Mar 09 15:59:41 2015 +0000
+++ b/main.cpp	Mon Mar 09 17:36:36 2015 +0000
@@ -1277,7 +1277,11 @@
     boom4.setSamplesTillHeld(5);
     boom4.setSampleFrequency();
 
-    motor_switch.setSampleFrequency(10000);
+    //motor_switch.setSampleFrequency(10000);
+
+    motor_switch.setSamplesTillAssert(5);
+    motor_switch.setSamplesTillHeld(5);
+    motor_switch.setSampleFrequency();
     motor_switch.attach_asserted_held( &keyPressedHeld );
     motor_switch.attach_deasserted_held( &keyReleasedHeld );
 
@@ -1293,8 +1297,8 @@
     activate_antenna();
     autosteer_timeout.start();
 
-    //setTunings(0.25, 5, 1);
-    SetDigitalFilter(phaseadv,tcenter, 0);
+    //setTunings(0.25, 5, 1);  //for PID
+    SetDigitalFilter(phaseadv,tcenter, 0);  //for FGPS guidance
 
     while(1) {
         //JH send version information every 10 seconds to keep Bluetooth alive
@@ -1345,8 +1349,8 @@
             // pc.puts(boomstate);
             lastboom18=boom18;
         }
-        if ( print_euler == 1 && angle_send == 1 ) 
-        { //&& reading == 0){
+        if ( print_euler == 1 && angle_send == 1 ) {
+            //&& reading == 0){
             lastpitch = 0.9*lastpitch + 0.1 * (toDegrees(get_pitch()*3.5));
             lastroll = 0.9 * lastroll + 0.1 * toDegrees(get_roll()*3.5);