Changing the BareMinimum?

Greetings!

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

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!

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

You can delete both the setup() and loop() functions, and replace them with the traditional C language main function, like so:

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

Blink example:

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.

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

Pete

El_supremo advice fits your need.

Here’s my BareMinimum:

BareMinimum.ino (11 Bytes)

But I don't think the OP want's to change the BareMinimum sketch but what the IDE shows when you open it.

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

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.

UKHeliBob: 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 :/

RedHundas: Greetings!

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

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!

RedHundas: Greetings!

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

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

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.