Writing the Arduino sketch

In the Arduino world, programs that you upload to the microcontroller are called sketches. You can write these sketches in a free integrated development environment (IDE) which can be downloaded from here: https://www.arduino.cc/en/Main/Software

Once you finalize a program, you upload it to your Arduino board using the upload button on the IDE and voila: your board starts doing what you asked it to do.

Every Arduino sketch will have two methods where you get to define the logic of your program:

  • setup(): For one-time initialization
  • loop(): For things that the board keeps doing forever until it runs out of power

Here's the code that we upload to the Arduino (see 9.13.arduino_sketch.ino):

const int triggerPin = 8; ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.