Coding

Guys please help i cant get anything to work i just simpely want a button i press then timer counts down and after relay activates but nothing i do work and with everything i add it gets worse with more problems i use arduino uno version of ide i dont know and windows

int buttonPin = 12;
int relayPin = 13;

void setup() {
// put your setup code here, to run once:
pinMode(relayPin,OUTPUT);
pinMode(buttonPin,INPUT);
}

void loop() {
if (digitalRead(buttonPin) == HIGH)
digitalWrite(relayPin, HIGH);
delay(5000);
{
if (digitalRead(buttonPin) == LOW)
digitalWrite(relayPin, LOW);
delay(5000);f
}
}

Post what you have so far. Use the code tags button above, </>

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you using?
What version IDE?
What OS are you using,Mac or Win?

What won't work?
Can you compile any code?

Thanks Tom... :slight_smile: