Notifications
Clear all

Basic startup question

3 Posts
2 Users
0 Reactions
103 Views
(@civil)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

This is very basic because I am starting from scratch with my knowledge of the Arduino. I wrote basic programs in the late 80's but haven't done anything since then.

When a sketch is downloaded to the Arduino I am assuming it has to be initiated to start running. If that being true, is there a way to start the sketch when the Arduino is power up. Without any manual initiation?

Thanks for your patience!

Bill


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7115
 

Posted by: @civil

This is very basic because I am starting from scratch with my knowledge of the Arduino. I wrote basic programs in the late 80's but haven't done anything since then.

When a sketch is downloaded to the Arduino I am assuming it has to be initiated to start running. If that being true, is there a way to start the sketch when the Arduino is power up. Without any manual initiation?

Thanks for your patience!

Bill

Either power on or pushing the reset switch if already running will re-initiate the sketch. It will run the procedure called 'startup' first , then if allowed run the procedure called 'loop' forever or until power is removed or the reset switch is pushed again.

Open the IDE, and open the Blink example (see attached pics for the steps) Notice the only two procedures startup and loop. Startup is executed once for each reset or power on, loop runs forever or until reset is pushed or power removed.

Screenshot 2024 05 08 at 11.17.51
Screenshot 2024 05 08 at 11.18.03
Screenshot 2024 05 08 at 11.18.14

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@civil)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

@zander thank you


   
ReplyQuote