Arduino Forum

Development => Suggestions for the Arduino Project => Topic started by: gregorss on Apr 15, 2019, 06:45 pm

Title: Code Template
Post by: gregorss on Apr 15, 2019, 06:45 pm
Hi there!

Since I have my special ways of writing code I made me a template. See attachment. I think everyone should be able to have his/her own code template (to be opened automatically when starting a new sketch).

What do you think?

Regards,

Gregor
Title: Re: Code Template
Post by: AWOL on Apr 15, 2019, 07:00 pm
Does your special way always include misspellings and missing return types?
Title: Re: Code Template
Post by: gregorss on Apr 15, 2019, 08:57 pm
Does your special way always include misspellings and missing return types?
These are mistakes I never do :-)

Regards,

Gregor

Okay ... here you are ...

Code: [Select]
// Name des Sketches

//-------|---------|---------|---------|---------|---------|---------|---------|

void setup()
{
}

void loop()
{
}
Title: Re: Code Template
Post by: pert on Apr 16, 2019, 06:10 am
I think everyone should be able to have his/her own code template (to be opened automatically when starting a new sketch).
The code that's added when you open a new sketch is from {Arduino IDE installation folder}/examples/01.Basics/BareMinimum. You can edit that file to whatever your preference is for new sketches. The Arduino IDE doesn't allow you to save example sketches so you'd need to do it using a regular text editor. The only problem is that, since the BareMinimum file is saved in the Arduino IDE installation folder, you need to redo this every time you update to a new version of the Arduino IDE. So you might want to save your template somewhere safe so it's quick and easy to copy it over to BareMinimum after updating the IDE.
Title: Re: Code Template
Post by: Juraj on Apr 16, 2019, 08:59 am
you could create a library with examples only
Title: Re: Code Template
Post by: gregorss on Apr 16, 2019, 02:06 pm
The code that's added when you open a new sketch is from {Arduino IDE installation folder}/examples/01.Basics/BareMinimum. ...
Great! Thanks!

Gregor
Title: Re: Code Template
Post by: pert on Apr 16, 2019, 09:39 pm
You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per