I have set up a simple "hello world" project using an LED in pin 13 and grd and telling it to blink ever 500ms. The circuit and programming seems to work, but it stops every 5 or so seconds, pauses, flashes a little and then continues. I can not remember if it has always done this so I was just wondering if it was suppose to or not?? :o
Do you have a current limiting resistor in series with the LED? Stick one on if you don't (330 ohm is OK); you need it if you don't want to fry the LED or the Arduino.
Pin13 --> 330 ohm R --> LED --> GND
I have a 100 Ohm resistor since that is all I have??
Are you saying you have it connected, or are you saying "all I have is a 100 ohm resistor, can I use that"?
If the former, it may be too small. If the latter, then try it - it can't be any worse (and probably will be better) than you have right now (no resistor?); if you have more than one, put 2 or 3 in series (to add up to 200 or 300 ohms) with the LED...
Well I had it with just the 1 100 Ohm resistor in place, but I have tried it with 5 100 Ohm resistors in place and it is still doing the same thing
Could it be in my coding??
/* Blink
Language: Arduino/Wiring
Blinks an LED attached to pin 13 every half second.
Connections:
Pin 13: + leg of an LED (- leg goes to ground)
*/
int LEDPin = 13;
void setup() {
pinMode(LEDPin, OUTPUT); // set pin 13 to be an output
}
void loop() {
digitalWrite(LEDPin, HIGH); // turn the LED on pin 13 on
delay(500); // wait half a second
digitalWrite(LEDPin, LOW); // turn the LED off
delay(500);
}
not my coding, its from a book :
And you've never, ever done it without a resistor (or anything else hooked to that pin)? Have you tried another pin (with the resistor/LED combo)?
What are you powering the Arduino with - how do you have it hooked up? Just the USB? Nothing else?
It's not the code; the code looks ok - basic, blink code.
I have unfortunately attached things in the past without resisters, when I was a complete noob, and have even blown LED's like that, which is why I was so concerned that I had broke the board, also I will try another pin now since it was an obvious thing for me to try ;D
nope does the same on a few of the other pins (have not tested all but 5-6 of them)
I have a horrid feeling it may be broke
I have just noticed something interesting while counting the flashes, and it flashes exactly 5 times then stops and splutters a little, then flashes 14 times and stops and splutters a little. A perfect sequence every time of 5 flashes then 14 ??
Sounds like a hardware problem. There's a chance the chip is damaged. Normally, I'd say that it's a decoupling problem, but this only applies to custom boards, and not the official arduino boards (which are already decoupled).
It sounds like the board is resetting. Try closing the Arduino program and anything that may be accessing the Arduino via the Serial connection. If it still doesn't work, try powering it from something other than the computer (battery, AC adapter, etc.)
But, to answer the thread title, it's unlikely the board is damaged. What's more likely is that the easily replaceable ATmega328 is damaged.
I have alrady reset my computer and tried the board in another USB slot and reloaded the program onto the board so thats not it. But I will try the other power source idea, but could someone please remind me which pins I must attach the battery to, and do I need a resistor in between? Thanks
to use battery as Arduino's power supply, I think youcan check this post.
It's very easy. ;D
but could someone please remind me which pins I must attach the battery to, and do I need a resistor in between
Just hook a 9V (for this purpose, it would be OK) to the barrel jack DC input; no resistor is needed. This will apply power to the regulator, then 5VDC from it to the ATMega; keep it disconnected from the USB, just to isolate away from that (it auto-switches, but not hooking it up will make troubleshooting easier).
If you still see the issue, though - since everything else is working (or seems to), then buying a pre-bootloaded 328 will be the next step (shouldn't cost more than $6-8.00 pre-shipping).
If you don't have a barrel adapter for a 9V, though, you can just attach the positive lead to VIN and the negative to one of the GND pins.
Um sorry maybe I should have mentioned before that mine Arduino board is not a ATMega but this one.
I dont know if this makes much difference to hooking up the battery or to my trouble shooting, if it does then sorry :-/
If you look at your pix you will see "power pins" at the bottom, where there are two Gnd and one Vin holes for connection wires.
Yea noticed those, thanks, will give it a go in the morning as it if 4:30AM here and I need sleep ;D
Just to clarify a few things (as you seem a little confused):
"Arduino" is the General name for official boards created by Massimo Banzi and co.
"Duemilanove"/"Diecimila"/"Mega" are all specific Arduino boards.
"ATmegaXXX" is a microcontroller created by Atmel. This is the chip the Arduino runs on. The XXX is a number (such as 168, 328, 1280, etc.)
There are other "clones" of Arduino which are basically the same, somtimes with minor modifications/improvements. The profits from these boards do NOT go to the development team who makes the official Arduino boards. There's nothing wrong with buying these, it promotes alternative clones :).