O'Reilly logo

Beginning C for Arduino: Learn C Programming for the Arduino and Compatible Microcontrollers by Jack Purdum

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

images

Program Loops in C

One of the things computers can do more efficiently than humans is repetitive tasks. People get bored and, when that happens, their attention drifts and errors in the task at hand creep in. Computers never get bored, so they are great at performing repetitive tasks. Unless a µc loses power or a component fails, they will loop forever, unless instructed to do otherwise.

In this chapter, you will learn:

  • What makes a “good” program loop
  • How to use a for loop
  • How to use the while statement
  • How to use a do-while statement and its differences
  • Infinite loops
  • The break and continue keywords

You have already used program ...

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