Go Down

Topic: start new sketch with setup and loop (Read 2456 times) previous topic - next topic

conradin

Hi all,
I wasnt sure where to put this.
Is there some way to have new sketches open with:
Code: [Select]

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?

WizenedEE

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

eried


Hi all,
I wasnt sure where to put this.
Is there some way to have new sketches open with:
Code: [Select]

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) :D
http://arduino.cc/forum/index.php/topic,118440.0.html
My website: http://ried.cl

CrossRoads

"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?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

eried


"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.
My website: http://ried.cl

robtillaart

my default sketch - and yes, I change it once a year -
Code: [Select]

//
//    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 :)
Rob Tillaart

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

WizenedEE


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 :)


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.

Go Up