Pages: [1] 2   Go Down
Author Topic: Help??  (Read 2243 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, I want to control four LEDs individually through my Arduino. I assume I'll have to use the breadboard, but I simply cannot find a tutorial on blinking multiple LEDs, let alone controlling it.

The code, I feel, will be fairly simple. I am lost on the circuitry and schematic and wiring and all that.

Link or help please? 0:-)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Output pin -> resistor 220R -> anode of LED -> cathode of LED -> ground.

http://www.arduino.cc/en/Tutorial/Blink

Do it 4 times with different pins.

« Last Edit: July 14, 2011, 11:14:45 am by Grumpy_Mike » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply and link! smiley

But how do I connect the wires on the breadboard? I don't have that many ground pins... inputs.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But how do I connect the wires on the breadboard?
I am a bit puzzled about what you don't understand. You get wire, strip a bit of insulation off the end and push it in the hole. Do the same for the other end and make a connection.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry, I'm really new to Arduino and I don't understand a lot (obviously).

I mean that I only have a limited number of places to connect a ground wire to. I don't really understand how to connect three to four LEDs to a ground wire...

I'm sorry... smiley-sad
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wire all the pins together on the bread board and then take one wire from the bread board and connect it to the ground on the arduino. All are at the same potential.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, thank you.

It doesn't matter where on the Bread Board?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No as long as they are connected together and not connected to any other signal the it physically doesn't matter where they are. It is only important where the electricity can flow.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, thank you very much! I've managed to blink two LEDs... Working on the 3rd.

I really appreciate it!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LEDs on the Bread Board are really dim.... What does that mean I'm doing wrong?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Either too much resistance or you haven't set the pins as outputs using the pinMode() function in the setup()
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You just have to do pinMode(LED, OUTPUT), right?
Because I did that smiley-sad

An LED plugged directly into the board is very bright. The first LED plugged into the BreadBoard is half lit. The second into the breadboard is so low that I have to cup my hands to see if it's lit. I'm assuming this is a resistance problem then. So, get smaller resistors?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33959
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a resistor in line with each LED. What value are you using?
You need to connect each LED to a different output pin and program up each one separately.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You just have to do pinMode(LED, OUTPUT), right?
Because I did that smiley-sad

An LED plugged directly into the board is very bright. The first LED plugged into the BreadBoard is half lit. The second into the breadboard is so low that I have to cup my hands to see if it's lit. I'm assuming this is a resistance problem then. So, get smaller resistors?

Well it's pinMode(PinNumber, OUTPUT); so you have to have declared the pin number correctly for the output pins you are wiring to. Post your code if you want us to see if you did everything correctly. What size resistors are you using, just anyone you grab doesn't work well? 220 to 1,000 should be fine to make it work without burning up an output pin. Higher then that and they can work but will be dimmer.

Lefty

 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

#define LED1 13
#define LED2 12
#define LED3 11
#define LED4 10

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

}

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


---
Logged

Pages: [1] 2   Go Up
Jump to: