how to start a new sketch with setup and loop auto written

i want to knbow how to start a new sketch with void setup and void loop are auto written in the sketch without me writting them

you must edit the sketch in the examples folder called BareMinimum.ino

for me it is located at

C:\Program Files (x86)\Arduino\examples\01.Basics\BareMinimum\BareMinimum.ino

this is my content

//
//    FILE: .ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.00
// PURPOSE: 
//    DATE: 
//     URL:
//
// Released to the public domain
//

void setup() 
{
  Serial.begin(115200);
  Serial.println("Start ");
}

void loop() 
{
}

In mine, I have code to turn pin 13's LED off, because it really grinds my gears (as they say on 9gag) to have it on when it serves no purpose.

it's already written in the examples but i want them written when i make a new sketch

that sketch is loaded as new sketch, you must edit it with another editor e.g. notepad++

robtillaart: that sketch is loaded as new sketch, you must edit it with another editor e.g. notepad++

sry but i dont understand

when you do FILE->NEW in the IDE (or start a new IDE) the bareminimum.ino sketch is loaded.

You can edit this file with the IDE but not save it on that location.

Therefore you must use another ASCII editor to edit it to your needs.

robtillaart: when you do FILE->NEW in the IDE (or start a new IDE) the bareminimum.ino sketch is loaded.

You can edit this file with the IDE but not save it on that location.

Therefore you must use another ASCII editor to edit it to your needs.

but the the bareminimum.ino sketch already has the setup and loop written in it but when i start a new sketch i cant find them

i cant find them

Can't find what? They're empty, it's just a skeleton for you to get the structure right.

Please change the bareminimum.ino file and save it to disk on its own location and see what happens when you start a new sketch.

The bareminimum.ino sketch is located in your Arduino distribution for me that is: C:\Program Files (x86)\Arduino\examples\01.Basics\BareMinimum

I do not know where you installed your Arduino installation or what OS you are working on

What version of the IDE are you using ? For me 1.0.5 loads an empty sketch with file/new whereas 1.5.6-r2 loads BareMinimum.ino although it is not named as such in the IDE

that’s my bare .ino sketch and thats when i open a new sketch

See my reply above. You are using IDE 1.0.5 and that's how it behaves. Upgrade the IDE and it will do what you want.

I use version 1.5.4 - that is why it works for me and not for you, sorry I did not know you were using IDE 1.0.5

UKHeliBob: See my reply above. You are using IDE 1.0.5 and that's how it behaves. Upgrade the IDE and it will do what you want.

you are right thank you :) :)

JimboZA: In mine, I have code to turn pin 13's LED off, because it really grinds my gears (as they say on 9gag) to have it on when it serves no purpose.

http://arduino.cc/en/Hacking/Bootloader