Go Down

Topic: Book "Getting started with Arduino", example 5.2 (Read 1 time) previous topic - next topic

AlvaroWang

Dec 12, 2017, 01:06 am Last Edit: Dec 12, 2017, 01:13 am by AlvaroWang Reason: So sorry, my photos were too big and my phone died, I made a very bad diagram.
Hello everybody, new guy here!

First let me say I am very happy to have your acquaintance, and very eager to be helpful when I get a good grip on how it all works, but right now I am very, veeeeery beginner.

So, my girlfriend got me an arduino and the book on the title of the post, and when trying example 5.2 where he asks me to put together 2 of the prior examples (a button and a LED), I couldn´t make it work for the life of me, I´ll show you my best guess and hopefully you can give me some insight :)
(I don´t think it has anything to do with the code because I just copied it, but there was no diagram, drawing or anything on how to mount it on the protoboard)

Mikeb1970

Hello,

Nice to see you here,

The most often when you have a problem the simplest solution works.
Have you checked that the LED is connected correctly, it's + and - side?

With regards,

Mike

AlvaroWang

Big leg to the right side, right?
I think this might be the only thing I did right

Mikeb1970

I'm sorry, but I don't have the book you mean, so without more info there isn't much I can do for you.

AlvaroWang

Thanks anyway, I´ll try to be more specific by tomorrow morning

avr_fred

#5
Dec 12, 2017, 01:37 am Last Edit: Dec 12, 2017, 01:38 am by avr_fred
The short led lead goes to gnd.

1) Move the wire from pin 9 to gnd. If the led lights, it is wired correctly.
2) If it does not light, reverse the led and try again.
3) Use any two opposite corners of the push button contacts, this will always work no matter how the button is oriented. For example, start with the top left contact and call that contact #1. Proceed clockwise and name the top right #2. Bottom right is 3 and bottom left 4. With that numbering scheme, use either pairs 1 & 3 or 2 & 4.

If that doesn't get things working, post your code with code tags (the </> icon) and a photograph of your breadboard.

larryd

No technical PMs.
The last thing you did is where you should start looking.

Paul_KD7HB

The short led lead goes to gnd.

1) Move the wire from pin 9 to gnd. If the led lights, it is wired correctly.
2) If it does not light, reverse the led and try again.
3) Use any two opposite corners of the push button contacts, this will always work no matter how the button is oriented. For example, start with the top left contact and call that contact #1. Proceed clockwise and name the top right #2. Bottom right is 3 and bottom left 4. With that numbering scheme, use either pairs 1 & 3 or 2 & 4.

If that doesn't get things working, post your code with code tags (the </> icon) and a photograph of your breadboard.

A warning! This last summer, a customer supplied a kit that contained a bag of red LEDS. From China. Some had the long-short leg polarity reversed!

Paul

larryd

#8
Dec 12, 2017, 06:16 am Last Edit: Dec 12, 2017, 06:16 am by larryd
A warning! This last summer, a customer supplied a kit that contained a bag of red LEDS. From China. Some had the long-short leg polarity reversed!

Paul
That happened to me.
Go by the 'flat side' as the cathode.


No technical PMs.
The last thing you did is where you should start looking.

EC-18C

If I am not mistaken, the problem lies in the LED connection. I had the same issue yesterday and got crazy over my code until i noticed the mistake in the wiring.

The LED should be connected to the PIN 9 and to GND via the resistor (if this does not solve the issue, try reversing the LED). The way you have it, both sides of the LED are HIGH at the same time so no current might flow, thus no light.

AlvaroWang

#10
Dec 12, 2017, 08:38 pm Last Edit: Dec 12, 2017, 08:43 pm by AlvaroWang
Hey thanks all for coming in

It seems my phone is too powerful and takes heavy pictures, I'll rry my best

AlvaroWang


AlvaroWang


AlvaroWang

The last photo.
Hey all, thanks a lot dor the welcome and the help, the legends are true, the arduino community really is great

larryd

OPs images

Please attach your code, don't take a image of it.











No technical PMs.
The last thing you did is where you should start looking.

Go Up