expected constructor, destructor, or type conversion before '(' token How to fix

I’m in the process of writing a program that will control my model railway layout I’m working on. I got the LCD working with no problems. I then began to add my buttons and led’s, I have only added one for the time being just to get it working. I used code from the Arduino website which I’ve used before with no problem. when I pressed verify it gave me an error saying expected constructor, destructor, or type conversion before ‘(’ token. Does anyone know how to fix this?

Many Thanks
Nat

Wat_Tyler_Programme.ino (958 Bytes)

int buttonState = LOW;
pinMode(ledpin, OUTPUT);
pinMode(buttonpin, INPUT);

Oops (double)

The compiler told you exactly where the problem was, but you chose not to share that information.

Why would you do that?

I used code from the Arduino website which I’ve used before with no problem.

Please provide a link to where you found this code.

   if (buttonState1 == HIGH) {

Next oops

digitalWrite(ledPin1, HIGH);

…and the one after that.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.