Winnie Liu / Hobbyking_Cheetah_0511

Dependencies:   mbed-dev FastPWM3

Files at this revision

API Documentation at this revision

Comitter:
WinnieLiu
Date:
Fri Jun 18 15:58:03 2021 +0000
Parent:
57:ae8105f28fbf
Child:
59:d53a7ccaae9a
Commit message:
refresh motor pid parameters after modifying on the setup menu and reload from the register

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jun 18 15:13:31 2021 +0000
+++ b/main.cpp	Fri Jun 18 15:58:03 2021 +0000
@@ -344,7 +344,12 @@
                 if (!prefs.ready()) prefs.open();
                 prefs.flush();                                                  // Write new prefs to flash
                 prefs.close();    
-                prefs.load();                                              
+                prefs.load();
+                /*----- change new pid controller parameter -----*/
+                //controller.kp = MOTOR_KP;
+                controller.ki = MOTOR_KI;
+                controller.kd = MOTOR_KD;
+                                                              
                 state_change = 1;
                 char_count = 0;
                 cmd_id = 0;