http://www.flickr.com/photos/video4net/4103124627 |
It's late at night and the corner traffic signal has broken down.
If the Finch can demonstrate the ability to follow the correct pattern for the corner traffic light,
you can earn big money hiring your robot out for the evening.
The corner traffic light is green for 4 seconds, yellow for half of a second and red for 2 seconds.
You will need to use the setLED and sleep commands to complete this program.
Copy and paste this program and add in your own information
to make the Finch's beak turn the right colors at the right times.
import edu.cmu.ri.createlab.terk.robot.finch.Finch; // Use the Finch methods import java.awt.Color; // Use colors /** * Created by: Yourname * Date: Today's date * Put your description here */ public class YourProgramName { public static void main(String[] args) { // PUT YOUR code HERE // Always end your program so the Finch will be reset for the next program myFinch.quit(); System.exit(0); } } |
green for 4 seconds yellow for half of a second and red for 2 seconds. |
Below is a Finch robot doing its best to impersonate a traffic light
Challenge: try the Morse code program