Go Down

Topic: Help?? (Read 2568 times) previous topic - next topic

lwa223

(That's just to get them to light up, I know that that code won't blink them ;))

Grumpy_Mike

When you post code select it and hit the # icon third from the right over the reply box.

You need to define all the LEDs you use:-
Code: [Select]
#define LED1 13
#define LED2 12
#define LED3 11
#define LED4 10

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

}

void loop()
{
  digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
  digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
delay(400);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
  digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
delay(200);

}


will flash them.

What resistor value are you using. Maybe it is time to post a photo of your wiring.

lwa223

I believe it's a 10 Kohm

retrolefty


I believe it's a 10 Kohm


That's over ten times too large. Again 200-1,000 ohms will let you see the light. One needed for each led.

Lefty

lwa223

Sorry, I was just using the smallest resistor I had in an Arduino pack I had.
I found a 1 ohm and a 1 kohm... so I hope the latter will work.

lwa223

Okay, the lights aren't dimmed. Success! :) Thank you!
However, I'm really still confused about the grounding wires. A complete electrical newbie like myself has really no idea how to wire wires together on a Breadboard... Or I thought I did, but it's not working. I'm kinda just shoving all the grounding wires from the LEDs to a place on the board with another wire nearby attaching to a ground pin. I'm assuming this is not right. Please help? I'm sorry I know I'm asking really easy questions... :/

Grumpy_Mike

That is right, assuming of course that the wire nearby is actually making electrical connection with all the LEDs.
Post a photo if you want us to spot your mistakes.

lwa223

I figured it out. I just attached a wire from the ground to the negative side of the Bread Board, then plugged all the other "ground" wires from the LED into it.


Thanks to everyone who helped! :)

Techone

@Iwa223
I just read this tread...Help??   If you need more help in electronics and how-to I recoment you purchase the book title : "Make : Electronics" by Charles Platt. My copy cost me $43.99 and I bought mine at Chapters. Or look-up on the Net and Google "Breadboard" or "How to Breadboard". Doing Ardiuno projects , A Breadboard is a MUST-HAVE.

Every time you do a circuit with the Ardiuno, the GND is connect with the Common side of the circuit you build. Example: pin 12 to resistor 470 ohms 5 % - green-purple-brown - gold -( Resistor have color codes !!! ) to anode of the LED and cathode  ( the flat side of the LED ) connect to the GND or Common. ( I use color codes for my wires - it less confusing - ex : red for positive, black or green for GND-common )

I am also new at the Arduino ( ATmega358 or into Microcontroller - PICAXE ), but I am not new in electronics ( being a Electronics Bench Technician for 4  years - going at DeVry Institue of Technology in Toronto in the early and mid 90's and hobby in electronics since 1980's and having books and magazines - like "Electronics Today international -Popular Electronics - Radio-Electronics" ) Heh, I am not like some the engineers on this board. Right now I even not working in my field !!!. But I still do my electronics hobbies and others - Models Kits.   

Techone

Here a picture of the wiring of 4 LED connect to the Ardiuno  - Disregard the resistors in the pictures, they should be 470 ohms - green-purple-brown and the GND connection.

lwa223

Thank you for the information. I think the hardware and wiring's fine now. Any issues are coming from code, which I can deal with :D

Go Up