|
- Java does not know how to talk to your robot.
All robots are different.
This is the statement to give Java the ability to communicate with a Finch robot
- Comments
- Class name
- Starting standard method
- Before you can talk to a Finch you must give it a name
This is called instantiating the robot
Finch ___ = new Finch();
is always the first thing to do in a Finch robot program.
- When you want the robot to do something, you refer to it by name and give it a command.
The saySomething command will send a message from the robot to the computer speakers to try to speak the words in the quotes.
If you don't hear anything, be sure your computer speakers are turned on!
- To prevent the program from ending immediately, before the robot has a chance to finish talking, tell the robot to wait.
The sleep command tells the robot to wait a certain number of milliseconds (1000 milliseconds = 1 second)
- The robot works better if you specifically tell it to quit and then tell the program to exit.
These aren't necessary, but they make it easier to keep the robot running from one program to another.
|