HAND SANITIZER DISPENSER

Sanitizer dispenser

The code can be downloaded at:

https://github.com/triantara/ARDUINO-TRIANTARA/blob/main/SOAP%20DISPENZER.zip

int led = 5;

void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);

}
unsigned long last = millis();
void loop()
{
int sensorValue0 = analogRead(A0);

if (sensorValue0 < 100)
{

if (millis() – last > 250) {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
}
last = millis();
}
else
{
digitalWrite(led, LOW);
}
}