So I've been experimenting with multiple " if " statements and I was wondering if there might be a simpler way to approach this or if this is the best way to go about it.
This is all hooked up to a single LED and two buttons. Each button makes it behave differently. This does work but it would be nice to be informed of a better way to do this.
int led = 13;
int button = 7;
int putton = 4;
int val = 0;
int con = 0;void setup()
{
pinMode(led, OUTPUT);
pinMode(button, INPUT);
pinMode(putton, INPUT);
}//*********************************************************************
void loop()
{
val = digitalRead(button);
con = digitalRead(putton);
if (val == HIGH)
{
digitalWrite(led, LOW);
delay(120);
}if (con == HIGH)
{
digitalWrite(led, LOW);
delay(60);
digitalWrite(led, HIGH);
delay(60);
}else
{
digitalWrite(led, HIGH);
}
}