Forked to initiate the Current Loop Gain

Dependencies:   mbed QEI DmTftLibraryEx

Revision:
33:f77aa3ecf87d
Parent:
32:1be3d79ff4db
diff -r 1be3d79ff4db -r f77aa3ecf87d Display/DisplayDriver.cpp
--- a/Display/DisplayDriver.cpp	Fri Apr 08 05:27:20 2022 +0000
+++ b/Display/DisplayDriver.cpp	Mon Apr 11 06:01:01 2022 +0000
@@ -542,7 +542,7 @@
 extern  uint16_t    aui16_PlotClears_Lo[240];
 extern  uint16_t    aui16_PlotClears_Hi[240];
 
-void    LCM_PlotVector  (uint16_t ui16_Background, uint16_t ui16_Foreground) {
+void    LCM_PlotScope  (uint16_t ui16_Background, uint16_t ui16_Foreground) {
 uint16_t    ui16_Index000;
 
     // LA:  Scope Bar Plot, Theory of Operation
@@ -569,3 +569,32 @@
         Tft.drawVerticalLineEx  (ui16_Index000, 300 - aui16_PlotClears_Hi[ui16_Index000], (int16_t) aui16_PlotClears_Hi[ui16_Index000]- aui16_PlotClears_Lo[ui16_Index000], ui16_Foreground);
     }
 }
+
+const int64_t   ci64_TargetPOS =    3096;   //
+
+extern  int32_t     ai32_POS2VelGraph[4000];
+extern  uint16_t    aui16_PlotPOS2VelSamples[240];
+extern  uint16_t    aui16_PlotPOS2VelClears_Lo[240];
+extern  uint16_t    aui16_PlotPOS2VelClears_Hi[240];
+
+extern  int32_t     ai32_POS2AccGraph[4000];
+extern  int32_t     ai32_POS2JrkGraph[4000];
+
+void    LCM_PlotSpeed   (uint16_t ui16_Background, uint16_t ui16_Foreground) {
+uint16_t    ui16_Index000;
+
+    for (ui16_Index000 = 1; ui16_Index000 < 240; ui16_Index000++) {
+
+        // 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);
+
+        // 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);
+        //
+        Tft.drawVerticalLineEx  (ui16_Index000, 150 - 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