Pages: [1]   Go Down
Author Topic: start new sketch with setup and loop  (Read 2275 times)
0 Members and 1 Guest are viewing this topic.
Maine
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
You blocked me on facebook and now youre going to die!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I wasnt sure where to put this.
Is there some way to have new sketches open with:
Code:
void setup(){}
void loop(){}

already in the sketch to start with?
I can type them every time, but I think it could be neat if I could have them there to begin with.
Is that already a feature? How can i get this done?
Logged

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can make an example and open it every time. This has been discussed before; try searching for it.
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I wasnt sure where to put this.
Is there some way to have new sketches open with:
Code:
void setup(){}
void loop(){}

already in the sketch to start with?
I can type them every time, but I think it could be neat if I could have them there to begin with.
Is that already a feature? How can i get this done?


I included the feature you ask, plus the cursor mouse automatically places inside the setup function (so you can start typing without even clicking) smiley-grin
http://arduino.cc/forum/index.php/topic,118440.0.html
Logged

My website: http://ried.cl

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 546
Posts: 27362
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

"plus the cursor mouse automatically places inside the setup function "
See, I'd find that in the wrong place - I start my sketches with some comments, then define pins, before even getting to void setup ( ) { ...

25 characters - what's that, like 10 seconds of typing?
Doesn't the bare minimum example have that already too?
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.

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"plus the cursor mouse automatically places inside the setup function "
See, I'd find that in the wrong place - I start my sketches with some comments, then define pins, before even getting to void setup ( ) { ...

25 characters - what's that, like 10 seconds of typing?
Doesn't the bare minimum example have that already too?

It does not matter, it finds the last line in the setup that is available to write code with a regex (line 585) it is not a hardcoded position.
Logged

My website: http://ried.cl

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 223
Posts: 13896
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my default sketch - and yes, I change it once a year -
Code:
//
//    FILE: .pde
//  AUTHOR: Rob Tillaart
//    DATE: 2012
//
// PUPROSE:
//

void setup()
{
  Serial.begin(9600);
  Serial.println("start...");
}

void loop()
{
}

Another nice way is to have a gaming keyboard e.g. - http://www.logitech.com/en-us/keyboards/keyboards/gaming-keyboard-g510 -
and program the "game" buttons for code snippets.
(rather expensive but smiley
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another nice way is to have a gaming keyboard e.g. - http://www.logitech.com/en-us/keyboards/keyboards/gaming-keyboard-g510 -
and program the "game" buttons for code snippets.
(rather expensive but smiley

I use some of the otherwise unused buttons (just pause and scroll lock now) to do random things --- pause used to change my desktop background, now it sleeps my computer; scroll lock inverts colors). On a normal desktop keyboard there's more (like the three buttons just right of the space bar). You could also remap some of the F_ keys.
Logged

Pages: [1]   Go Up
Jump to: