Book Image

Arduino Essentials

Book Image

Arduino Essentials

Overview of this book

Table of Contents (17 chapters)
Arduino Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Uploading our first sketch


Once you know how to connect the board to your computer and how to let the Arduino development environment know about it, the moment has come to create our first real test.

We will upload the simplest sketch to the Arduino board just to confirm that all parts are correctly set up and that you can, for sure, begin to work with it and learn how to program it.

What we will do is load one of the examples that comes with the Arduino development environment, in particular, one called Blink that makes use of the onboard integrated LED to make it do just that—blink.

To do this, go to the File menu in the menu bar and select the Examples command, navigate to 01.Basics, and select Blink.

The Arduino development environment should open a new window containing the following code for that example:

/*
  Blink
  Turns on an LED for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards...