2011

Dependencies:   mbed FastPWM

Revision:
85:a3b46118b5cd
Parent:
73:f80dc3970c99
Child:
86:b8ed7abddeb2
diff -r c355d3e52bf1 -r a3b46118b5cd CAN/function_CAN.cpp
--- a/CAN/function_CAN.cpp	Sat Jul 11 06:52:32 2020 +0000
+++ b/CAN/function_CAN.cpp	Sun Jul 12 06:25:51 2020 +0000
@@ -24,6 +24,7 @@
 extern DigitalOut LED;
 
 extern float x_past[];
+extern float x_future[];
 extern float f_past[];
 extern float f_future[];
 extern float input_NN[];
@@ -745,6 +746,11 @@
         }
         x_past[num_array_x_past-1] = pos.sen / ENC_PULSE_PER_POSITION;   //mm
         
+        for(int i=0;i<num_array_x_future-1;i++){
+            x_future[i] = x_future[i+1];
+        }
+        x_future[num_array_x_future-1] = 31.25f;  //N
+        
         for(int i=0; i<num_array_f_past-1;i++){
             f_past[i] = f_past[i+1];
         }
@@ -763,6 +769,11 @@
         }
         input_NN[ind] = (pos.sen / ENC_PULSE_PER_POSITION) / 60.0f;
         ind = ind + 1;
+        for(int i=0;i<numfuture_x;i++){
+            input_NN[ind] = x_future[2*i+2] / 60.0f;
+            ind = ind + 1;
+        }
+        
         for(int i=0;i<numpast_f;i++){
             input_NN[ind] = f_past[2*i] / 10000.0f + 0.5f;
             ind = ind + 1;