I get the following :
error: expected unqualified-id before '{' token
here is my code
/***********************************************************************************
Wiring
Pin 2 - Float Switch A51
Pin 3 - Float Switch A99
Pin 4 - Float Switch B51
Pin 5 - Float Switch B99
Pin 6 - selenoid valve 1
Pin 7 - selenoid valve 1
Pin 8 - selenoid valve 1
Pin 9 - selenoid valve 1
Pin 10 - LED
Control Behavior:
liquid comes in through a manifold under vaccum to 2 tanks (A,B)
Vaccum is pulled in both tanks trhough selenoid valves 1 and 2
tanks are emptied via gravity flap once pressure equalise with the atmosphere.
pressure is equalised using selenoid valve 3 and 4
tanks are fed liquid through check valves from the manifold
tanks have 2 float switches each one at 51% capacity one at 99% capacity
behaviour is as follow: as tank A reaches 51% liquid level vacuum is started to be pulled from tank B
tanks get liquid equally until tank A reaches 99%
tank A no longuer has vacuum pulled and equalise pressure, releasing liquid
tank B keeps filling up until 51% then vaccuum is pulled on tank A
External Resources
***********************************************************************************/
//define the input/output pins
#define A51FLOAT_SWITCH_PIN 2
#define A99FLOAT_SWITCH_PIN 3
#define B51FLOAT_SWITCH_PIN 4
#define B99FLOAT_SWITCH_PIN 5
#define Valve_1_PIN 6
#define Valve_2_PIN 7
#define Valve_3_PIN 8
#define Valve_4_PIN 9
#define LED_PIN 10
//setup runs once
void setup()
{
//setup input pins for float switch
//Too use a bare switch with no external pullup resistor, set the pin mode to INPUT_PULLUP to use internal pull resistors. This will invert the standard high/low behavior
pinMode(A51FLOAT_SWITCH_PIN, INPUT_PULLUP);
pinMode(A99FLOAT_SWITCH_PIN, INPUT_PULLUP);
pinMode(B51FLOAT_SWITCH_PIN, INPUT_PULLUP);
pinMode(B99FLOAT_SWITCH_PIN, INPUT_PULLUP);
//setup output pins for relays/pumping station and LED board
pinMode(Valve_1_PIN, OUTPUT);
pinMode(Valve_2_PIN, OUTPUT);
pinMode(Valve_3_PIN, OUTPUT);
pinMode(Valve_4_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
}
//loop() runs indefinitely
void loop()
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
//empty
if (digitalRead(A51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(A99FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B99FLOAT_SWITCH_PIN) == LOW);
digitalWrite(Valve_1_PIN, HIGH); //open vacuum to A
digitalWrite(Valve_2_PIN, LOW); //open vacuum to B
digitalWrite(Valve_3_PIN, LOW); //purge A
digitalWrite(Valve_2_PIN, LOW); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
//a51
if (digitalRead(A51FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(A99FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B99FLOAT_SWITCH_PIN) == LOW);
digitalWrite(Valve_1_PIN, HIGH); //open vacuum to A
digitalWrite(Valve_2_PIN, HIGH); //open vacuum to B
digitalWrite(Valve_3_PIN, LOW); //purge A
digitalWrite(Valve_2_PIN, LOW); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
//a99
if (digitalRead(A51FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(A99FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(B51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B99FLOAT_SWITCH_PIN) == LOW);
digitalWrite(Valve_1_PIN, LOW); //open vacuum to A
digitalWrite(Valve_2_PIN, HIGH); //open vacuum to B
digitalWrite(Valve_3_PIN, HIGH); //purge A
digitalWrite(Valve_2_PIN, LOW); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
//b51
if (digitalRead(A51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(A99FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B51FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(B99FLOAT_SWITCH_PIN) == LOW);
digitalWrite(Valve_1_PIN, HIGH); //open vacuum to A
digitalWrite(Valve_2_PIN, HIGH); //open vacuum to B
digitalWrite(Valve_3_PIN, LOW); //purge A
digitalWrite(Valve_2_PIN, LOW); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
//b99
if (digitalRead(A51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(A99FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B51FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(B99FLOAT_SWITCH_PIN) == HIGH);
digitalWrite(Valve_1_PIN, HIGH); //open vacuum to A
digitalWrite(Valve_2_PIN, LOW); //open vacuum to B
digitalWrite(Valve_3_PIN, LOW); //purge A
digitalWrite(Valve_2_PIN, HIGH); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}
{
//check to see the state of the float switches. These states are assuming the pin is using an internal pullup resistor.
// LOW corresdponds to the float switch being at its lowest point (i.e. low water)
if (digitalRead(A51FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(A99FLOAT_SWITCH_PIN) == LOW);
if (digitalRead(B51FLOAT_SWITCH_PIN) == HIGH);
if (digitalRead(B99FLOAT_SWITCH_PIN) == LOW);
digitalWrite(Valve_1_PIN, HIGH); //open vacuum to A
digitalWrite(Valve_2_PIN, HIGH); //open vacuum to B
digitalWrite(Valve_3_PIN, LOW); //purge A
digitalWrite(Valve_2_PIN, LOW); //purge B
digitalWrite(LED_PIN, HIGH); //turn on the LED
}