Go Down

Topic: Changing the BareMinimum? (Read 702 times) previous topic - next topic

RedHundas

Greetings!

So, as you may know the arduino sketches always start like that:

Code: [Select]

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}


I found out that this default code is called "BareMinimum", but I think that those comments are really unnecessary and I'd like to start with a blank page.

Do any of you know how to do so?

Thanks in advance! 


septillion

I'm not sure if that's possible. But you can always save a blank sketch and open that (and use save as).

But most of the time I simply press Ctrl + A, Del and start with a complete blank page. (Or actually, most of the time I use Notepad++ to write(A). Like the code completion and name matching function.)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

#2
Oct 19, 2016, 06:07 pm Last Edit: Oct 19, 2016, 06:08 pm by JimEli
You can delete both the setup() and loop() functions, and replace them with the traditional C language main function, like so:

Code: [Select]

int main( void ) {               
  //your code here...
}


Blink example:

Code: [Select]

int led = 13;

int main( void ) {               
  pinMode( led, OUTPUT );     
  for ( ;; ) {
    digitalWrite( led, HIGH );
    delay( 1000 );
    digitalWrite( led, LOW );
    delay( 1000 );
  }
}


BTW, compiling the empty main() function sketch results in an Arduino Uno 138 byte hex file.

el_supremo

In the Arduino distribution is the file ...\arduino-1.6.12\examples\01.Basics\BareMinimum\BareMinimum.ino
Change it any way you like.

Pete
Don't send me technical questions via Private Message.

Budvar10

El_supremo advice fits your need.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

outsider

#5
Oct 20, 2016, 05:58 am Last Edit: Oct 20, 2016, 06:00 am by outsider
Here's my BareMinimum:

septillion

But I don't think the OP want's to change the BareMinimum sketch but what the IDE shows when you open it.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

UKHeliBob

But I don't think the OP want's to change the BareMinimum sketch but what the IDE shows when you open it.
Which in my experience is the BareMinimum sketch but not named as such.  You get the same thing when you do File/New

Here is mine
Code: [Select]


void setup()
{
  Serial.begin(115200);

  Serial.println();
}

void loop()
{

}

A blank line to insert global variables if required
The setup() function including Serial.begin(), a blank line ready to insert code and a Serial.println() ready to print something which is a frequent requirement when testing code snippets
The loop() function with a blank line ready to insert code
All braces on their own line.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

septillion

Which in my experience is the BareMinimum sketch but not named as such.  You get the same thing when you do File/New
Damn, you are right! I always thought BareMinimum was just a saved version of what the IDE gives you when you start it. But I'll be damned, it's indeed the other way around, it's indeed BareMinimal itself what the IDE gives you on start up / new. Mm, time to edit it. Indeed remove the stupid line but more to fix the most annoying part, the blank lines in loop() and setup() after the comment has not indent! This messes up indentation from A LOT of newbies here :/
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

jurs

Greetings!

So, as you may know the arduino sketches always start like that:

Code: [Select]

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}


I found out that this default code is called "BareMinimum", but I think that those comments are really unnecessary and I'd like to start with a blank page.

Do any of you know how to do so?
Default text in the "new file" code editor window depends on the IDE version you are using.

From Arduiono IDE version 1.0 up to 1.0.6 the code editor starts with a completely blank page.
If you prefer a "blank page" against "bare minimum",you could simply  use IDE version from 1.0 to 1.0.6!

julyjim

Greetings!

So, as you may know the arduino sketches always start like that:

Code: [Select]

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}


I found out that this default code is called "BareMinimum", but I think that those comments are really unnecessary and I'd like to start with a blank page.

Do any of you know how to do so?

Thanks in advance! 


Allow me to use an analogy
When you going out into a rain you can use you judgment a take a bumpershoot with  you,
or your mother will tell you to do so.
In computer terminology - it is called "implied" - depending on situation behavior or "explicit" - directed behavior.
The "BareMinimum" IMPLIES it will pass by compiler , it will not do much, but it will be a working application.

Not everything in computer word will be spelled  out for you, as in this case your carefully crafted blank page will explicitly  turn into sea of red messages from compiler.

But it won't be total loss, you will have  to analyze the errors and fix it.
Or post them here and let others fix it for you.

Best  of luck to you.
Jim



dlloyd

Yes, tried editing and it worked.

  • On my PC, in the path "C:\Program Files (x86)\Arduino\examples\01.Basics" reset the Read-only attribute of the BareMinimum folder.
  • In a different text editor, edit BareMinimum.ino to your own preference.
  • Save, then change the BareMinimum folder back to Read-only.
Now when you use [File][New] or Ctrl+N, your edited file will open.

Go Up