how to load a sketch permanently on the board

:( i managed to write a simple script for my first project however every time i have load it through the mac using a usb cable and the IDE software. i thought as long do not make changes the stitch would be stored on the board on the flash memory i just need to power up the board and it should crank the code. nut it does not. what am i missing ?

regards kindy

Hi, How do you know that the sketch has not been stored in the arduino? Have you tried the blink example in the IDE, unplugged the USB then plugged it back in, to see if the LED still blinks?

Tom.... :)

How can you tell when the sketch runs?

i have a button to energise a relay beside i also have a wifi shield that does not turn on the link led

google XY problem

you lost your keys inside the house, but are looking outside because it's brighter outside.

something is wrong with your setup, hardware, software, something.

go back, load blink and see if the unit blinks.

i understand from this is that i need not do any thing and the sketch should be already i the flush. but i need to check my settings, so i will load the blink and see how it behave, thanks

interesting the blink works, so the flush is permanent, i do not know what could be the problem, because if i load fro the IDE it works

malkindy:
because if i load fro the IDE it works

How else would you load your sketch ?

…R

How are you powering up the board when not using the IDE? Are you still using USB for power, or a battery? If using a battery/external supply, are you sure that your new power source can deliver enough current for the items attached (don't count on it if you are trying to use a 9volt brick)?

The only difference IMO is the Serial Monitor, which is connected only when the IDE is running and has the right COM port selected. In case your sketch depends on a Serial connection, it will not work until you connect a terminal program to the port, like putty.

What happens when you upload your sketch, then press the Arduino reset button? Does your sketch still work?

What when you disconnect, reconnect, wait some time, then press reset?

One difference is that the USB supplies enough current to run the Arduino AND most peripherals,, a ( volt 'transistor' battery will not always, specially with comm boards. 9 volt wall wart will also work with some comm boards. Relay coils can gobble up power too.

DrDiettrich: The only difference IMO is the Serial Monitor, which is connected only when the IDE is running and has the right COM port selected. In case your sketch depends on a Serial connection, it will not work until you connect a terminal program to the port, like putty.

What happens when you upload your sketch, then press the Arduino reset button? Does your sketch still work?

What when you disconnect, reconnect, wait some time, then press reset?

the above solved my problem :) thanks all for the support, i did not realised that i have the: Serial.begin(9600); while (!Serial) in my sketch for debugging and monitoring :sweat_smile: . i learned the hard way always

thanks again

malkindy: the above solved my problem :) thanks all for the support, i did not realised that i have the: Serial.begin(9600); while (!Serial) in my sketch for debugging and monitoring :sweat_smile: . i learned the hard way always

thanks again

knowledge comes from experience experience comes from failure. our collective posts are from our collective knowledge, ergo experience, ergo failures. welcome to the club !