Newbee programming issues

I am very new to programming Arduino. My programming back ground is ladder logic so this has been quite the learning curve. I am coming up with different ideas to try simple programs just to learn. What I am trying to do is have "switch" blink a red led and when the state has changed I want to blink a green LED. But as you will see in my first "if" statement I want to use "offButton" as kind of a on/off switch for the LEDS blinking. I am sure there is an easier way but I am not sure what is wrong with this code. At the bottom I have pasted the error message I am getting. Sorry I am new to the forum thing so hopefully I am doing this correctly. Any help would be awesome. Thank you.

//Constant Variables
int ledPin = 13; //Names pin 13 as ledPin for programming ease.
int redLED = 26;
int Switch = 24;
int offButton = 28;

// Variables that will change 0 or 1.
int buttonState1 = 0;
int buttonState2 = 0
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Communication speed.
pinMode(ledPin, OUTPUT); //Sets ledPin (pin 13) as an output.
pinMode(redLED, OUTPUT);
pinMode(Switch, INPUT_PULLUP);// Sets Switch (pin 24 as an input. PULLUP is the internal Pullup resistor. (Pin supplies volts other side of button goes to ground. NPN switching)
pinMode(offButton, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState2 = digitalRead(offButton);
if (buttonState2 == HIGH)
{
buttonState1 = digitalRead(Switch); //sets "buttonState" to the read high or low reading.
if (buttonState1 == HIGH) //if Switch is high then run code in {}
{
digitalWrite(redLED, HIGH);//Sets pin to on/high.
digitalWrite(ledPin, LOW);
delay(100); //Holds pin low for 250ms.
digitalWrite(redLED, LOW);
delay(100);
}
else
{
digitalWrite(ledPin, HIGH);
digitalWrite(redLED, LOW);
delay(50);
digitalWrite(ledPin, LOW);
delay(50);
}

}
else {
digitalWrite(redLED, LOW);
digitalWrite(ledPin, LOW);
}
}
Error: Switch_with_two_lights_one_blinking._With_comments:3: error: expected unqualified-id before numeric constant
Switch_with_two_lights_one_blinking._With_comments:10: error: expected ',' or ';' before 'void'
expected unqualified-id before numeric constant

Hi,

//Constant Variables
int ledPin = 13; //Names pin 13 as ledPin for programming ease.
int redLED = 26;
int Switch = 24;
int offButton = 28;

// Variables that will change 0 or 1.
int buttonState1 = 0;
int buttonState2 = 0;   // MISSING ; HERE
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); //                                        Serial dot begin(9600);
  pinMode(ledPin, OUTPUT); //Sets ledPin (pin 13) as an output. // Serial. <--- begin(9600);
  pinMode(redLED, OUTPUT);
  pinMode(Switch, INPUT_PULLUP);// Sets Switch (pin 24 as an input. PULLUP is the internal Pullup resistor. (Pin supplies volts other side of button goes to ground. NPN switching)
  pinMode(offButton, INPUT_PULLUP);
}
void loop() {
  // put your main code here, to run repeatedly:
  buttonState2 = digitalRead(offButton);
  if (buttonState2 == HIGH)
  {
    buttonState1 = digitalRead(Switch); //sets "buttonState" to the read high or low reading.
    if (buttonState1 == HIGH) //if Switch is high then run code in {}
    {
      digitalWrite(redLED, HIGH);//Sets pin to on/high.
      digitalWrite(ledPin, LOW);
      delay(100); //Holds pin low for 250ms.
      digitalWrite(redLED, LOW);
      delay(100);
    }
    else
    {
      digitalWrite(ledPin, HIGH);
      digitalWrite(redLED, LOW);
      delay(50);
      digitalWrite(ledPin, LOW);
      delay(50);
    }

  }
  else {
    digitalWrite(redLED, LOW);
    digitalWrite(ledPin, LOW);
  }
}

One of the rules here is to use the </> ( the left icon) to insert your code and

autoformat your code for people who want to help you here.

  1. Use the byte type for your fixed pins/switches/buttonstates, etc

  2. If it is a constant (cannot be changed), use const

example: const byte ledPin = 13;

  1. Look for && (And) in the learning section
 if (a == b && c ==d)  // it means ONLY when a is equal to b AND c is equal to d, you do something
{ //do something here

}
  1. INPUT_PULLUP means using the internal pullup of the chip

so the input of your switch or whatever is HIGH*****

in your main loop, you should want to see if that attached switch/button is LOW

from HIGH to LOW(when you press it).

  1. I would suggest you check out the examples and the preference in the "Learning" section.

  2. Check out the blink without delay and debouncing examples too.

its fun going from ladder logic to C

A few tips I find helps

if you are using the arduino programming interface then bottom left is a number that indicates the line that the cursor is on.

The error code normally shows a number that the error is on. Yours said line 10.

code small then compile in the beginning as that makes errors easier to find

always scroll to the first error and work on that one first. Just like ladder logic the program is top to bottom so the first error can cause multiple errors all the way down the program. Once the error is fixed compile then repeat until its happy.