Programing help

I am trying to program an Arduino UNO with two digital inputs and one output, with 30 second time delay. I will appreciate if someone help me with this. thanks Masoud

Request seems basic enough:

void setup(){
pinMode (2, OUTPUT);
pinMode (3, OUTPUT);
pinMode (4, INPUT);
digitalWrite (4, HIGH);
}
void loop(){
delay (30000);
}

you can find a tutorial on the Digital Pins here: http://arduino.cc/en/Tutorial/DigitalPins

masoud: I am trying to program an Arduino UNO with two digital inputs and one output, with 30 second time delay. I will appreciate if someone help me with this. thanks Masoud

Which bits have you got working, which bit are you having trouble with? What attempt have you made to solve the problem yourself?

CrossRoads: void setup(){ pinMode (2, OUTPUT); pinMode (3, OUTPUT); pinMode (4, INPUT); digitalWrite (4, HIGH); } void loop(){ delay (30000); }

This just isn't going to cut it. He wants 2 Inputs and 1 Output. Also, he didn't specifically request the internal pull-up... :roll_eyes:

void setup(){
pinMode (2, INPUT);
digitalWrite (2, HIGH);
pinMode (3, INPUT);
digitalWrite (3, HIGH);
pinMode (4, OUTPUT);

}
void loop(){
delay (30000);
}

2 inputs, 1 output, 30 second delay (that repeats & repeats). Pullups on digital inputs won't hurt, and will prevent random results when read.