code for sterring wheel interface

Dependencies:   MBC002-DigitalIn

Revision:
8:f8a9b7dbf399
Parent:
7:e80a50f5b898
Child:
9:33d8b36e81d4
diff -r e80a50f5b898 -r f8a9b7dbf399 main.cpp
--- a/main.cpp	Thu Jun 28 11:55:19 2018 +0000
+++ b/main.cpp	Thu Jun 28 13:40:21 2018 +0000
@@ -2,8 +2,11 @@
 
 // DEFINE AN ARRAY FOR EACH COMMAND I NEED
 
-int ARRAY_SOURCE[] = {342,171,21,64,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,1};
-int ARRAY_TEL[] = {342,171,21,64,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,1};
+//int ARRAY_SOURCE[] = {342,171,21,64,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,1};
+//int ARRAY_TEL[] = {342,171,21,64,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,1};
+
+int ARRAY_SOURCE[] = {9000,4500,560,1690,560,560,560,560,560,1690,560,1690,560,1690,560,560,560,1690,560,560,560,1690,560,1690,560,560,560,560,560,560,560,1690,560,560,560,560,560,560,560,1690,560,560,560,1690,560,560,560,560,560,560,560,1690,560,1690,560,560,560,1690,560,560,560,1690,560,1690,560,1690,560,26};
+int ARRAY_TEL[] = {9000,4500,560,1690,560,560,560,560,560,1690,560,1690,560,1690,560,560,560,1690,560,560,560,1690,560,1690,560,560,560,560,560,560,560,1690,560,560,560,560,560,560,560,1690,560,560,560,1690,560,560,560,560,560,560,560,1690,560,1690,560,560,560,1690,560,560,560,1690,560,1690,560,1690,560,26};
 
 //DEFINE MY OUTPUTS "led" is IRLED connected on PC_0, "myled" is STM32 NUCLEO board-led
 DigitalOut myled(LED1);
@@ -60,10 +63,10 @@
   if ( BIT % 2==0) {           
              myled =1;
               led =1;
-             wait_ms (ARRAY_SEND[BIT]/38);}
+             wait_us (ARRAY_SEND[BIT]);}
  
  else {            
              myled =0;
               led =0;
-             wait_ms (ARRAY_SEND[BIT]/38);}
+             wait_us (ARRAY_SEND[BIT]);}
 }}}}
\ No newline at end of file