I have just dug into my
Arduino Starter Kit, where I have reached project 2 “Spaceship interface”. I have noticed that my kit don't contain 10 k ohm resistor. Is that alright?
So, the coding is set up and it looks alright.
But happen with the circuit. No LED light at all.
Could you help me out?
Best,
Janosch
With 4-pin pushbuttons, the safest way to wire them is to connect one pin to ground and the diagonally opposite pin to the Arduino input. Use pinMode(pin, INPUT_PULLUP). The input pin will read LOW when pressed and HIGH when not pressed. No resistor required.
Under Files->Examples->Basic, there is a program called Blink.
Try running it and see if the LED on the UNO blinks.
That will at least tell you the UNO is OK
@PaulRB Thank you for your support.
Sorry mate but I am newbie, project 2. Thats how far I got. Back to you instructions, where do to insert the code and where to wire?
I will insert the entire code the next post
@TomGeorge Thank you for support. Maybe, you saw it straight away, I am a newbie. Hehe. I have the post from Perry and know more the "T & C" of the form. I Just straight execute the learning from there, here you get the code from Arduino project and I how code it in Auto Format by Arduino IDE
int switchState = 0;
void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, INPUT);
}
void loop() {
switchState = digitalRead(2);
if (switchState == LOW) {
//the button is not pressed
digitalWrite(3, HIGH); //green LED
digitalWrite(4, LOW); //red LED
digitalWrite(5, LOW); //red LED
} else { //thr button is pressed
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
delay(250); //wait for a quarter second
//toggle the LEDs
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(250); //wait for a quarter second
}
} // go back to the beginning of the loop
@TomGeorge Now I install you code. But before I do so, please keep in my mind that I am a newbie. Actually, I shall work with the code in the book because that's my learning curve and the book keeps building on from project to project.
@jim-p
I found the program the Blink. Unfortunately, no, blink @jim-p . Maybe I do something fundamentally wrong. I dont know. I have to be honest, it's challenging when there is nobody on your side, I mean in the real world to show me how it works.