All the previous but the PID

Dependencies:   mbed QEI PID DmTftLibraryEx

Revision:
34:0522cebfe489
Parent:
33:f77aa3ecf87d
diff -r f77aa3ecf87d -r 0522cebfe489 Display/DisplayDriver.cpp
--- a/Display/DisplayDriver.cpp	Mon Apr 11 06:01:01 2022 +0000
+++ b/Display/DisplayDriver.cpp	Mon Apr 11 09:20:40 2022 +0000
@@ -570,7 +570,8 @@
     }
 }
 
-const int64_t   ci64_TargetPOS =    3096;   //
+//extern  const int64_t   ci64_TargetPOS =    3096;   //
+extern  int64_t ci64_TargetPOS;
 
 extern  int32_t     ai32_POS2VelGraph[4000];
 extern  uint16_t    aui16_PlotPOS2VelSamples[240];
@@ -587,14 +588,13 @@
 
         // LA:  Clear Previous Plot by means of the Hi/Lo Array(s)
         //
-        Tft.drawVerticalLineEx  (ui16_Index000, 150 - aui16_PlotPOS2VelClears_Hi[ui16_Index000], (int16_t) aui16_PlotPOS2VelClears_Hi[ui16_Index000]- aui16_PlotPOS2VelClears_Lo[ui16_Index000], ui16_Background);
+        Tft.drawVerticalLineEx  (ui16_Index000, 175 - aui16_PlotPOS2VelClears_Hi[ui16_Index000], (int16_t) aui16_PlotPOS2VelClears_Hi[ui16_Index000]- aui16_PlotPOS2VelClears_Lo[ui16_Index000], ui16_Background);
 
         // LA:  Then PLOT the New
         //
-//        aui16_PlotPOS2VelClears_Hi[ui16_Index000] = (uint16_t) (ai32_POS2VelGraph[(uint16_t)((float)ui16_Index000* ((float)ci64_TargetPOS/ (float)240.0))]/ 2);
-        aui16_PlotPOS2VelClears_Hi[ui16_Index000] = (uint16_t) (ai32_POS2VelGraph[(ui16_Index000* ci64_TargetPOS)/ 240]/ 2);
-        aui16_PlotPOS2VelClears_Lo[ui16_Index000] = (uint16_t) (ai32_POS2VelGraph[((ui16_Index000* ci64_TargetPOS)/ 240)- 1]/ 2);
+        aui16_PlotPOS2VelClears_Hi[ui16_Index000] = (uint16_t) (ai32_POS2VelGraph[(ui16_Index000* ci64_TargetPOS)/ 240]/ 3);
+        aui16_PlotPOS2VelClears_Lo[ui16_Index000] = (uint16_t) (ai32_POS2VelGraph[((ui16_Index000* ci64_TargetPOS)/ 240)- 1]/ 3);
         //
-        Tft.drawVerticalLineEx  (ui16_Index000, 150 - aui16_PlotPOS2VelClears_Hi[ui16_Index000], (int16_t) aui16_PlotPOS2VelClears_Hi[ui16_Index000]- aui16_PlotPOS2VelClears_Lo[ui16_Index000], ui16_Foreground);
+        Tft.drawVerticalLineEx  (ui16_Index000, 175 - aui16_PlotPOS2VelClears_Hi[ui16_Index000], (int16_t) aui16_PlotPOS2VelClears_Hi[ui16_Index000]- aui16_PlotPOS2VelClears_Lo[ui16_Index000], ui16_Foreground);
     }
 }
\ No newline at end of file