The purpose of this code to is check the 3 float switches in the laminator chamber for water. The float switches vote with the majority winning. A momentary switch must be pressed for the section of code (//// START FILL LAMINATOR FROM 70GALLON RES ///) to be active.We can also take water from the reservoir using a different button (latching):///// START Fill Water Bucket///START set pins  ///const int startBucket =5;const int pumpBucketValve =6;const int startButton = 7;const int floatSwitch1 = 8;const int floatSwitch2 = 9;const int floatSwitch3 = 10;const int pumpPower = 11;const int pumpBallValve = 12;///END set pins  //////START set pins values  ///int floatSwitchState1 = 0;int floatSwitchState2 = 0;int floatSwitchState3 = 0;int summedValue = 0;int pumpPowerState = 0; //turns pump on and opens the ball valve to the laminatorint startButtonState = 0;int startBucketState = 0;int pumpBucketValveState = 0;///END set pins values  //////START set pins mode  ///void setup() {pinMode(floatSwitch1, INPUT);pinMode(floatSwitch2, INPUT);pinMode(floatSwitch3, INPUT);pinMode(pumpPower, OUTPUT);pinMode(pumpBucketValve, OUTPUT);pinMode(startButton, INPUT);pinMode(startBucket, INPUT);}///END set pins modes  ///void loop() {//// START FILL LAMINATOR FROM 70GALLON RES ///startButtonState = digitalRead(startButton);if (startButtonState == HIGH) {    while (checkFloat >= 2) {      digitalWrite(pumpPower, HIGH);    }      digitalWrite(pumpPower, LOW);}//// END FILL LAMINATOR FROM 70GALLON RES //////// START Fill Water BucketstartBucketState = digitalRead(startBucket);while (startButtonState == HIGH) {      digitalWrite(pumpBucketValve, HIGH); //turn ball valve to on    }digitalWrite(pumpBucketValve, LOW); //turn ball valve to off///// END FILL Water Bucket}int checkFloat() {    summedValue = 0;    floatSwitchState1 = digitalRead(floatSwitch1);    if (floatSwitchState1 == HIGH) {      summedValue = summedValue + 1;    }    floatSwitchState2 = digitalRead(floatSwitch2);    if (floatSwitchState2 == HIGH) {      summedValue = summedValue + 1;    }    floatSwitchState3 = digitalRead(floatSwitch2);    if (floatSwitchState3 == HIGH) {      summedValue = summedValue + 1;    }    return summedValue;}
Checking for automating water topoff
c++;arduino