Just done my first Arduino circuit, Just an LED on a timer meant to be on for 5 then off for 1 second, however after a few cycles of the loop the LED is flickering on and off quickly?
Any ideas?
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/22
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(5000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
Doing the first circuit in the pdf doc.
Powering the board through the USB port.
Taking 5v jumper to bread board + line
GND to negative line on breadboard.
lead from pin 13 to + on the 10mm LED
Negative from LED into 560 ohm resistor onto negative line on breadboard.
I dont understand why I am connecting a fly lead from 5v on Arduino to the + line on the breadboard as this is not used for anything ant the circuit works the same without it?
I have loaded the standard blink code from the file suplied with the download (blink.pde)
I have disconnected all wires and the same thing is happening.
When I connect the USB cable.
The light runs on a 10 second loop without error it then flashes three times in under a second, then pauses for a about 1/2 second flashes twice and then runs for 10 seconds without error.
Also I am unable to clear the memory using the reset button. How long do I need to hold this in to flush the memory?
Also I am unable to clear the memory using the reset button. How long do I need to hold this in to flush the memory?
The reset pin never 'flushes' or 'clears' any memory. Hitting reset causes a jump to the internal bootloader code that then waits a short period to see if there is a new program to upload from the PC. If it doesn't see a new upload request it then jumps to whatever the last sketch program loaded.
I can't help much sense you have the new Uno board that I don't have and so many problems are being reported that it's not clear which problems are just new users doing something wrong or possible bugs in the new boards or new IDE functions to support them.
The code you have posted works fine on my Uno (and 2009 board). There is something magic in it...
What i can't help but think is that the behavior you describe is the initial state the Uno arrives in. It blinks a message in Morris-code.
When you press the upload button, do you see a flurry of activity on the tx/tx LEDs, after the compile is completed? Have you selected the correct board and serial port in the IDE? What IDE are you using and what is the OS you are running on?
Based on the video, it looks like it may be getting reset somehow. From what I can tell you are using a laptop. Try a different USB port and see what happens. If the same result, maybe try powering it from an external source. Almost any standard power adapter (DC) with a barrel connector will work. Make sure it is under 12 volts and has the center pin as +. Also maybe something more than 500 mA since technically that should be the limit of the USB port. But I'm not sure how the UNO negotiates high power usage from the USB.
Just wanted to update you all on this. This evening I emailed the supplier of my kit. Within 10 minutes I received the below email. ;D I think this is a stunning show of excellent customer service. I will of course let you know if the new board resolves the problem.
regards
Tom
Thanks for the video, I must admit we've never seen anything quite like it.
The random flicker is particularly strange because the reset light on the Arduino isn't flickering.
It could be a number of things but I think your suspicions that it's something to do with the Arduino is most likely right.
We'll ship you out a replacement tomorrow (Wednesday) I'm afraid we need to return the faulty board so we'll include a prepaid envelope, if you could slip the faulty board in and drop it in a post box that would be great.