O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required