Hi all, I'm very new at this and I've got a problem. I've searched the forum and couldn't find the answer.
I upload some simple code and everything works fine, but when I power off and on again (USB) it won't start running the code. The power light works fine but a very simple code won't start.
This is probably a newbie question but I could use some help.
I've waited several minutes and nothing. The code is the DigitalReadSerial with a tiny modification. The third example in andruino tutorial. A program to send to the serial port the status of a digital input.
I know that the program is not working because the TX led don't light up when I click the push button, like when I upload the sketch.
When it works, the TX led flash every time I click the pushbutton, when I turn off and on it does nothing.
Opening or reopening the serial monitor don't change anything.
Is there any known problem with the USB/Serial in Win7?
When I upload the code it goes to the flash memory right? To the non-volatile memory?
How is your switch wired, could you be fighting a 'floating input' problem? Typically one needs a pull-up (internal or external) or pull-down resistor (external only) to interface with a switch correctly.
How is your switch wired, could you be fighting a ‘floating input’ problem? Typically one needs a pull-up (internal or external) or pull-down resistor (external only) to interface with a switch correctly.
I have a pull-down resistor and everything works good when I upload the code, but after plug off and on… Nothing!
Should it be a hardware problem or am I making anything wrong?
Once per second I send some data over serial and toggle the LED on Pin 13. I did the LED on Pin 13 because I want to know the sketch is running. Immediately after upload I see Pin 13 Toggle and the TX LED flicker once per second. All as expected.
When I remove power and re-attach power, just like you, I don't see anything on the TX LED. But, the Pin 13 LED continues to toggle once per second, just like before. At this point if I open the Serial Monitor, everything works as expected.
It appears the Uno needs an active connection before sending data over USB. (This behavior is not the same as the Duemilanove which isn't a huge surprise since it has a different USB to Serial interface.)
[SOLVED]
Ok thanks a lot.
Today I've already notice that, I've inserted a heartbeat on pin13 and even after unplug and plug it's works..
Like you said, for it to send it needs some sort of initialization on the PC side, and that's not a problem for me.
I'm currently developing an application in vb.net to receive inputs on arduino so I just initialize the serial connection every time I start the program, also I can make the PC application to close and reopen the serial if it can't connect.
Everything works great now.