Terminology
Sketch
A ‘sketch’ is a program in Arduino terminology.
Creating The Project
Open the ‘Arduino’ software.
Create A New Sketch
Menu > File > New Sketch
Menu > Tools > Board
Select the board you are using
Menu > Tools > Serial Port
Ensure the Arduino is connected to your computer and then select the virtual serial port your Arduino board has been connected to
A Basic Sketch
//*****************************
//*****************************
//********** DEFINES **********
//*****************************
//*****************************
#define LED 13
//***************************
//***************************
//********** SETUP **********
//***************************
//***************************
void setup()
{
//------------------------------
//----- SETUP THE IO PORTS -----
//------------------------------
pinMode(LED, OUTPUT);
}
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//**********************************************************************************************************************************************
//***********************************
//***********************************
//********** MAIN FUNCTION **********
//***********************************
//***********************************
void loop()
{
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
delay(500);
}
Running
To verify / compile the sketch press the Verify button.
To run the sketch press the ‘Upload’ button.
