void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
analogWrite(A0, LOW); //set internal pull-down resistor
analogWrite(A1, LOW);
analogWrite(A2, LOW);
}
// the loop function runs over and over again forever
void loop() {
if(A0 > 2.5 and A1 < 2.5 and A2 < 2.5)
{
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(2500);
}// wait for a second
else if(A0 > 2.5 and A1 > 2.5 and A2 < 2.5)
{
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage 2.5
delay(2000);
}
else if(A0 > 2.5 and A1 > 2.5 and A2 > 2.5)
{
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
}
else if(A0 < 2.5 and A1 < 2.5 and A2 < 2.5)
{
analogWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(20); // wait for a second
analogWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
}
}