Finch Remote Control

Create a program that listens for six characters:  f, b, l, r, x, q. The program should exit when 'q' is pressed. For the other commands, the Finch should move as follows:

  • Forward for 'f'
  • Backward for 'b'
  • Turn right for 'r'
  • Turn left for 'l'
  • Stop moving for 'x'

Extension:  This program can be made more complex by adding more controls for other outputs. For example, use 'g' to turn the beak green. Alternatively, have the user enter 'c' for color. Then the program can ask the user for three values for red, green, and blue intensity and set the LED to those values.

Extension:  If the user hits 'f,' the Finch should move only if there are no obstacles in front of it.

Assignment Category: