Program Uploads and runs then disappears after a power cycle.

Hi. I’m not certain if the problem is with my Arduino Uno R3 or my program.

With the USB into my computer the sketch links (inc 2 additional libraries; MIDI and Keypad), compiles and uploads with no problem. It then runs well on the board -any time a keypad button is pressed MIDI is outputted and the TX LED flashes. If I push the reset button on the board it comes straight back up and continues to work as before. If I unplug the USB and then plug it either back in to the computer or into an external USB power supply nothing works and I have to re-upload the sketch before it’ll work again.

The weird thing is I tried uploading the Blink program and that one is kept when the USB in pulled out and re-plugged. I then tried with the example MIDI program on http://arduino.cc/en/Tutorial/Midi and that one does get lost. Is it something to do with the libraries getting lost at reset? I’ve tried this on two boards both of which were brand new from RS about a week ago.

I’ve attached the sketch. Does anyone have any ideas?!

M

Mark_Keypad_Synth.ino (2.34 KB)

I'm really sorry, I've realised I made a mistake and it is working. How do I delete this thread?!

What were you doing wrong? I am having the same issue without any idea what to do to keep code from disappearing with a power cycle.

Hi

It turned out that the lights flashing on the board were not indicating output from the TX pin but output into the USB. Having power cycled if I waited for long enough for the USB Serial to start working on my computer again it flashed as expected. Once I plugged in the MIDI interface I had no problems!

Sorry I can't be of more help.

M