Pages: [1]   Go Down
Author Topic: Clear Program before making new circuit  (Read 261 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Always tinker with stuff
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can not find a way to clear my UNO smiley-sad  I have worked with micro controllers before and this is always the first thing to do before wiring up a new circuit. I have searched the subject and it appears, against all reasonable logic, that one just builds a new circuit, then connect the power, which loads the previous circuit program. How can this not immediately destroy everything?
Maybe I just am not understanding the most fundamental things here.
I just received my UNO today and have the blink program running. I created a new sketch with nothing entered, clicked upload, but that does not clear it.
So, if it is true that one just creates any circuit and powers it up with any program, that does not fry it, please explain why it does not destroy it. If there is a way to clear first, please post the sketch.
Stuck at the plate for now, what do I do?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not an expert, but i typically upload the new code, then build the circuit, then power the microcontroller. I've never come across a way to clear it, but im certain there is one. Hopefully someone else can answer the question more specifically.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can just load a simple code, like blink.
Or a sketch that does nothing, part will power up with all IO as inputs:

void setup (){
while(1); // gets here & just sits ...
}
void loop (){}

[edit - mis-named function corrected]
« Last Edit: February 20, 2014, 03:19:25 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
Always tinker with stuff
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ty all for fast reply, CrossRoads post worked, but changed void sketch to void setup for those who may run across this thread. Now off to first base smiley
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, little too much on the mind today ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 89
Posts: 3488
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why bother to write your own ?
The IDE  comes with a program that does nothing apart from running the empty loop() function.  No input, output, voltages on pins etc  Look at the BareMinimum example.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Saskatchewan, Canada
Offline Offline
Edison Member
*
Karma: 34
Posts: 1205
Coding Geezer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why bother to write your own ?
The IDE  comes with a program that does nothing apart from running the empty loop() function.  No input, output, voltages on pins etc  Look at the BareMinimum example.

You can get the BareMinimum example by using the IDE's menu. File->New.  It will pop up a new IDE window containing a sketch with a setup() and loop().  Upload that, and build your circuit. Rename it by using File->Save As.
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 89
Posts: 3488
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

File/New just gives me a blank edit window here in 1.0.5. What version of the IDE are you using ?
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Saskatchewan, Canada
Offline Offline
Edison Member
*
Karma: 34
Posts: 1205
Coding Geezer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

File/New just gives me a blank edit window here in 1.0.5. What version of the IDE are you using ?

Interesting. I'm using 1.5.4
Logged

Pages: [1]   Go Up
Jump to: