O'Reilly logo

Arduino Workshop by John Boxall

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

Chapter 5. Working with Functions

In this chapter you will

  • Create your own functions

  • Learn to make decisions with while and do-while

  • Send and receive data between your Arduino and the Serial Monitor window

  • Learn about long variables

You’ll learn new methods to make your Arduino sketches easier to read and simpler to design by creating your own functions. You can also create modular, reusable code that will save you time again and again. We’ll introduce a way to make decisions that control blocks of code, and you’ll learn about a type of integer variable called the long. Then you will use your own functions to create a new type of thermometer.

A function consists of a set of instructions that we can use anywhere in our sketches. Although many functions ...

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