Hi, I have just purchased an Arduino Uno and am new to this. I have some experience in ‘C’ but my programming knowledge emanates from the age of IBM Advanced BASIC. My knowledge of electronic comes from the same relative ancient period, even thermionic valves! Now, I have set the Arduino up OK and it connects to the laptop, the green led is on and the default blink program runs. I have loaded the basics-blink program and that will run BUT only for a few seconds. Then the TX/RX lights flash once or twice and it stops. Is this normal please? The program code seems to indicate that it should run indefinitely until stopped.
It is the code that comes with the application under File - Examples - Basics - Blink.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://arduino.cc
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
The onboard led flashes anyway when it is plugged into the USB and I think it must have a built in blink sketch which is in conflict somehow with the uploaded sketch.
What I have since done is to plug in another LED into pin 12 and amend the code to send the output there. Initially the TX/RX lights flash profusely for a second or two and then it settles down. The uploaded sketch works with the pin 12 led flashing continuously. The on-board led is lit all the time and does not flash.
Yes - 450 ohms. I only put the led there to see if it worked. Still not sure why there would be an issue with pin 13 though. I have also switched off the laptop, taken out the battery to make sure any cache is cleared and re-booted with the UNO connected. The laptop definitely knows it is there and it communicates with it - it is just this sketch, so far. I am running Windows 7, 64 bit.