Wrtite Sketch
If you learning about programming will familiar with scripts. In arduino system, the scripts is a code and writen at application (Arduino IDE) which called a Sketch. Without Sketch Aruduino can not work or controlling a system.
To run the Arduino IDE follow the instruction below :
- Klik ikon Arduino
- Then will show figure :
Type the following code :
The result show figure :
const int PIN_12 = 12;
voide setup ()
{
pinMode (PIN_12, OUTPUT);
}
void loop ()
{
digitalWrite(PIN_12, HIGH);
delay (1000); //delay 1 second
digitalWrite(PIN_12, LOW);
delay (1000); //delay 1 second
}
To save our project :
- click File Menu
- Click Save As...This step show dialog with tittle "Save Sketch folder as..."
How Verification Sketch
Before download sketch to arduino, we must verify the sketch to know programming is corect. Sketch which written at Arduino IDE is understanding by human, but not for Arduino. In order to Arduino understand what We write, it need to be verify. To Verification we only click verify. In this process if any mistaken about sketch will be show.
The result of verification sketch is Binary File that will be download to Arduino.
Upload Binary Sketch
If in verification process not error, then we will download the sketch to Arduino. To downloading only click Upload. If success will show "Done Uploading "
After binary sketch upload, Code will execute by Arduino. And the result led will blink.
Congrotulation, it succes !!!
Than we well Undestanding about codes at sketch.
Belum ada tanggapan untuk "Work With Arduino, Controlling Led (First Experiment)"
Post a Comment