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

Get Arduino Sketches: Tools and Techniques for Programming Wizardry 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.