Introductory Programs

Assignments that teach Introductory Programs

Typical introductory programs that use the Finch rely on the "set" methods of the API to create scripts that cause the Finch move, change its beak color, or say something.  

Although a simple Finch program requires several extra lines compared to the very simplest type of "Hello World" program, we have not found these to be distracting to students.  This is especially true in the case of a language like Java, where the first program students are presented with already contains several mysterious lines (e.g., public static void main(final String[] args)) that are typically explained later in the course.  

Generally, first programs that use the Finch will need to have an import statement to add the Finch library, and they will need to have a line to instantiate the Finch object.  If you wish to get students started quickly, we recommend that you start students with a skeleton file that includes those lines - such a skeleton is provided in the Finch java download (the FinchTemplateFile.java in the Code package).  

Students should learn four methods to create interesting scripts with the Finch:  saySomething, setWheelVelocities, setLED, and sleep.  With these four methods, a student can create a program of arbitrary length that changes the Finch beak's color, drives it around, and has it "say" phrases through the computer's speakers.

Of the four methods, sleep is often the least understood by students.  Sleep is required to ensure that the program's output is visible to the user - e.g., if I set the LED to green and then to blue without an intervening sleep, the LED will flash green for an infinitesimally short period.

We have observed great success in using a part of a class period to have students begin creating scripts with the Finch.  The teacher can roll out the methods one at a time, explain how they operate, and demonstrate the need for sleep.   

Comments

Unable to see introductory program code.

I am unable to download/see practice exercises for Jython. as soon as I click the link it takes me to Python source code page.

am I doing something incorrectly ?

thanks !
D

Most of the assignments

Most of the assignments currently posted to the site can be used for either python or java.

Unlike the Java package download which has a large number of sample programs, the Jython package only has three examples, though they do cover the basics of sensing, actuation, and using computer peripherals like speakers and internet data through RSS. Consider downloading the Java package to look at the example programs if you'd like more ideas for what to do with Finch.