Try this slightly modded blink. Open the serial monitor and see if it tells you it's in setup() once then at the top of loop() each time through.
/*
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://www.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);
Serial.begin(9600);
Serial.println("in setup()");
}
// the loop function runs over and over again forever
void loop() {
Serial.println("in 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
}
Yep, I see the message setup() and then adds loop() message every second. The only thing blinking is TX, not the L
JimboZA:
Try this slightly modded blink. Open the serial monitor and see if it tells you it's in setup() once then at the top of loop() each time through.
/*
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://www.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);
Serial.begin(9600);
Serial.println("in setup()");
}
// the loop function runs over and over again forever
void loop() {
Serial.println("in 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
}
OK well that at least tells us the board's not stuffed. The Tx will blink each time it does the Serial.println();
Next thing is to get a loose LED and resistor and put the anode into pin13 and the cathode to ground and see if it blinks, and / or try the same on another pin.
I have similar problem but on the Arduino Leonardo and Arduino Leonardo Eth. When I upload the example program the diode on the board is blinking but it seems that there is no voltage on the output pins. Because it is the same on both boards I suspect I'm missing something basic.
Boards are powered with the USB cable, they are new and I'm using latest IDE on Windows 7.
I've uploaded the program sending messages thru serial port. I can see in_loop messages and the diode is blinking. Any idea why there is no voltage on the output pins?
Did anyone ever sort this one out? I have exactly the same problem with a Uno Wifi R2. Everything works as expected, built in LED blinks nicely on for 10s and off for 10s. An external LED+resistor work perfectly when connected between +5V and GND, but not when connected pin 13 to GND. Any ideas?
(Powering Uno from 12V DC input. Other sketches work OK and power other pins OK.)
Code below. Apart from a couple of jumper wires sticking out of pin 13 and the GND next to it (so I can probe with my DMM) there is no attached circuit. Same result regardless of power by USB or 12VDC input.
Unlike the classic Uno, the builtin LED on the Uno WiFi is on pin 25:
#define LED_BUILTIN 25
So it's normal and expected that the external LED you connect to pin 13 won't be affected by code that uses LED_BUILTIN. You need to change LED_BUILTIN in your code to 13 to affect pin 13.
sterretje:
I have no experience with the 4809 micro on your board but the CHANGE looks odd to me
It looked odd to me too, and I was halfway through a reply explaining that it was wrong to do this, but I try to never assume I know what I'm talking about (since so often I don't), so I gave it a try, and it works! Turns out, this provides a toggle function:
Thanks guys; setting the output pin to 25 works on the physical pin 13 on my Uno WiFi 2. The voltage on the pin is present, but, as expected, the built in LED doesn't flash so I guess I have to switch both to have them both flashing together.
For the enum CHANGE thing; see my previous question "Using boolean variables instead of HIGH/LOW in digitalWrite();"
JimboZA:
OK well that at least tells us the board's not stuffed. The Tx will blink each time it does the Serial.println();
Next thing is to get a loose LED and resistor and put the anode into pin13 and the cathode to ground and see if it blinks, and / or try the same on another pin.
hi, I have the same problem here, the led on arduino uno board doesn't work although the loose led with resistor works. did anyone solve this problem?