O'Reilly logo

Arduino Sketches: Tools and Techniques for Programming Wizardry by James A. Langbridge

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

CHAPTER22

Robot

This chapter discusses the following functions of the Robot library:

  • begin();
  • motorsWrite()
  • motorsStop()
  • turn()
  • pointTo()
  • compassRead()
  • updateIR()
  • knobRead()
  • keyboardRead()
  • digitalRead()
  • analogRead()
  • digitalWrite()
  • analogWrite()
  • beginSpeaker()
  • beep()
  • playMelody()
  • playFile()
  • tempoWrite()
  • tuneWrite()
  • robotNameWrite()
  • robotNameRead()
  • userNameWrite()
  • userNameRead()
  • cityNameWrite()
  • cityNameRead()
  • countryNameWrite()
  • countryNameRead()
  • beginTFT()
  • beginSD()
  • drawBMP()
  • displayLogos()
  • clearScreen()
  • text()
  • debugPrint()
  • drawCompass()
  • parseCommand()
  • process()

The hardware needed to use these functions includes:

  • Arduino Robot
  • 2 x TinkerKit connection cables and digital inputs
  • Arduino Esplora (presented and programmed in Chapter 21)

You can find the code download for this chapter at http://www.wiley.com/go/arduinosketches on the Download Code tab. The code is in the Chapter 22 folder and the filename is Chapter22.ino.

Introducing Robot Library

Over the years, there have been several attempts to teach programming languages to children. Teachers and governments wanted to show children that programming isn't magic, and that simple logic is all that was required. The British Broadcasting Corporation, BBC for short, even went as far as to create its own computer for schools to accompany a television series on computer programming. It was a huge success and was just one of many projects. One of these projects was the Logo programming language.

Most programming languages are mathematical: ...

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