Go Down

Topic: Alternating Blink Program (Read 929 times) previous topic - next topic

Luk_11

Okay, so I am trying to modify the example Blink program just a tiny little bit. Here's my program code:

const int LED1 = 10;
const int LED2 = 11;

void setup(){
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}

void loop() {
 digitalWrite(LED1, HIGH);
 digitalWrite(LED2, LOW);
 delay(1000);
 digitalWrite(LED1, LOW);
 digitalWrite(LED2, HIGH);
 delay(1000);
}

The code should be correct, at least I don't get an error message. But something must be wrong with my wiring, since nothing happens (see attachments).  I hope you can see what's going on in the picture: The two resistances are not on the same rail. As far as I know, the breadboard is internalle connected along a vertical line but not horizontally. So I really don't know why this is wrong. 

Can anyone please help me out ? ( I know probably a really stupid question).


Luk_11

Also, I have connected the long end of the diodes (anode I think) with the resistance and the short end to ground.

aarg

#2
Dec 04, 2017, 07:12 pm Last Edit: Dec 04, 2017, 07:15 pm by aarg
Everything is wrong with your wiring. Most of the wires connect to nothing at all. Have you looked at which pins are common on the breadboard?

It would behoove you to draw a proper schematic and show an image here so we can see directly how you are trying to implement this. Actually, it should have been your first step.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Luk_11

hey, thx for your answer!

What do you mean by "have you looked at which pins are common on the breadboard?"

Anyways, I think I missunderstood the breadboard: it seems only the outermost two columns are connected vertically and the ones in the middle are connected horizontally. So I corrected my wiring and it is still wrong. I am trying to implement the sketch that you can see in the attachements as well. This is a sketch for the Arduino Uno and I am trying to implement it on the Mega2560, but it shouldn't be of any difference now, should it?

MarkT

#4
Dec 05, 2017, 11:55 am Last Edit: Dec 05, 2017, 11:56 am by MarkT
hey, thx for your answer!

What do you mean by "have you looked at which pins are common on the breadboard?"
It means do you know how the breadboard works?

Quote
Anyways, I think I missunderstood the breadboard: it seems only the outermost two columns are connected vertically and the ones in the middle are connected horizontally.
You just figured out how a breadboard works.

Quote
So I corrected my wiring and it is still wrong. I am trying to implement the sketch that you can see in the attachements as well. This is a sketch for the Arduino Uno and I am trying to implement it on the Mega2560, but it shouldn't be of any difference now, should it?
First check that you can light the LED from the +5V pin via resistor, get that working first, then
connect resistor to the Arduino pin.  Post your code (in code tags) if its changed.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

tkbyd

For others folloing this thread who aren't "old hands" with breadboards... which are worth their weight in gold, by the way, and come in many shapes and sizes... see...

https://computers.tutsplus.com/tutorials/how-to-use-a-breadboard-and-build-a-led-circuit--mac-54746

TomGeorge

Hi,
Do you have a DMM?

Are you sure your resistors are 470R?

If you lift the wire out of pin10 and connect it to a 5V pin, does the LED light?
This way you are applying 5V to the LED through the resistor.

Try the same with the pin11 wire?

Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up