this is one of my first programs and my error message says "expected ')' before ';' token" in the void loop() function please help
(Please use code tags. Thanks! Moderator.)
// set pin numbers:
const int buttonPin[] = {5,6}; // the number of the pushbutton pins
const int relayPin = 13;// the number of the relay pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(relayPin, OUTPUT);
// initialize the pushbutton pin as an input:
for(int x=0; x<2; x++)
{
pinMode(buttonPin[x], INPUT);
}
}
void loop(){
// read the state of the pushbutton value:
for(int x=0; x<2; x++)
{
(buttonState = digitalRead(buttonPin[x]);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH && buttonPin[x] == 2) {
// turn LED on:
digitalWrite(relayPin, LOW);
}
if (buttonState == LOW && buttonPin[x] == 2) {
// turn LED on:
digitalWrite(relayPin, HIGH);
}
if (buttonState == HIGH && buttonPin[x] == 3) {
// turn LED off:
digitalWrite(relayPin, LOW);
}
}
}