code for sterring wheel interface

Dependencies:   MBC002-DigitalIn

Revision:
4:faec61d0b6c0
Parent:
3:82270ac03cb7
Child:
5:6dc69540b634
diff -r 82270ac03cb7 -r faec61d0b6c0 main.cpp
--- a/main.cpp	Wed Jun 27 11:33:57 2018 +0000
+++ b/main.cpp	Wed Jun 27 12:44:01 2018 +0000
@@ -4,7 +4,6 @@
 int ARRAY_SOURCE[] = {10,5,10,5,10,5,10,5,};
 int ARRAY_TEL[] = {5,10,5,10,5,10,5,10,};
 
-
 //DEFINE MY OUTPUTS "led" is IRLED connected on PC_0, "myled" is STM32 NUCLEO board-led
 DigitalOut myled(LED1);
 DigitalOut led(PC_0);
@@ -40,10 +39,10 @@
 
 // DEFINE for each button pressed which is the array to send
 // IF any button is pressed the outputs level is 0
-int ARRAY_SEND;
+int ARRAY_SEND[8];
 int i;
-       if(pushButton1 == 1)  {for (i=0;i<8;i++){ARRAY_SEND[i]=ARRAY_SOURCE[i];}}
-  else if(pushButton2 == 1)  {for (i=0;i<8;i++){ARRAY_SEND[i]=ARRAY_TEL[i];}}
+       if(pushButton1 == 1)  {for (i=0;i<8;i++){ARRAY_SEND[i]=ARRAY_SOURCE[i]};}
+  else if(pushButton2 == 1)  {for (i=0;i<8;i++){ARRAY_SEND[i]=ARRAY_TEL[i]};}
         else {
             
             // LEDs Turn-Off