Hi,
the code trying to print out the items in commands one by one and/or some one, got ERROR need help please.
Thanks
Adam
char ButtonA01, ButtonA02, ButtonB01, ButtonB02, ButtonC01, ButtonC02, ButtonD01;
char commands[] = {ButtonA01, ButtonA02, ButtonB01, ButtonB02, ButtonC01, ButtonC02, ButtonD01};
//// TOTAL 8 commands
int i, j;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
i = 5;
updateMessage(i);
Serial.print(" updateMessage(i)=");
Serial.println(updateMessage(i));
}
void updateMessage(i)
{
for ( i = 0; i < 8; i++)
dataToSend[8] = commands[i];
}
ERROR:
Arduino: 1.8.16 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
sketch_mar22c:22:21: error: variable or field 'updateMessage' declared void
void updateMessage(i)
^
C:\Users\HUA.DELLV-PC\Documents\Arduino\sketch_mar22c\sketch_mar22c.ino: In function 'void loop()':
sketch_mar22c:15:3: error: 'updateMessage' was not declared in this scope
updateMessage(i);
^~~~~~~~~~~~~
C:\Users\HUA.DELLV-PC\Documents\Arduino\sketch_mar22c\sketch_mar22c.ino: At global scope:
sketch_mar22c:22:21: error: variable or field 'updateMessage' declared void
void updateMessage(i)
^
exit status 1
variable or field 'updateMessage' declared void
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.