Java is one of the most-used programming languages in industry today, and it is also the language of AP Computer Science and many college introductory courses. Our Java library allows students to use Java, to read the Finch sensors, and control the Finch wheels, lights, and buzzer. To use Java with the Finch, you must connect to the Finch via Bluetooth with the BlueBird Connector. To use Bluetooth with Windows, you will need a BLE bluetooth dongle. We support native Mac Bluetooth for Macs with Bluetooth 4.0. This includes all devices manufactured after 2014, and many devices from before that. Older Macs without Bluetooth 4.0 need to use the BLE bluetooth dongle.

Browser-based Java editors are not compatible with the Finch. You can use any offline Java editor with the Finch. If you don’t have a favorite, we suggest trying Eclipse.

Preparing the Finch

Insert a micro:bit into the Finch. Connect the micro:bit to the computer with the USB cable.

The micro:bit will appear as an external device on your computer. Download this file and drag it onto the micro:bit.

The micro:bit will begin flashing three letters on its LED screen. At this point, you can unplug the USB cable from the micro:bit. You won’t need it because you will be using bluetooth to connect to the Finch Robot.

To turn on the Finch press and hold the power button on the bottom of your Finch until until one or more of the LEDs in the tail turn on. This should take about 2 seconds. Three letters should now be flashing on the micro:bit.

When you turn on your Finch the color of the tail LEDs will indicate the battery charge level.

  • Four green lights: Your Finch is fully charged.
  • Three green lights: Your Finch is partially charged.
  • Two yellow lights: You have about 2 hours of charge left on your Finch.
  • One red light: You should charge your Finch immediately. Your Finch will turn off soon.

The Finch has a rechargeable battery located inside. To charge the Finch, plug the micro USB into the charging slot beneath the Finch’s tail. Plug the other end of the cord into a USB charging port.

Note: Plugging the micro USB into the micro:bit will NOT charge the Finch!

To fully charge the Finch requires 7 hours of charging time. Charging overnight is a great option!

If the Finch is inactive for 10 mins without connecting to Bluetooth, or for 20 minutes while connected to Bluetooth, it will switch off to save battery power. The Finch will play a disconnecting sound and also show its battery status using the tail LEDs as listed in the last step.

Connecting to the Finch

If you are using a Windows machine or a pre-2014 Mac, insert the BLE Bluetooth dongle into your computer. If you are using a Mac with Bluetooth 4.0 (all devices manufactured since 2014), you can skip this step.

Open the BlueBird Connector. It will begin finding the robots around you. Click on the name of your robot. Each robot is flashing its initials on the micro:bit to help you figure out which is which.

When you connect to your Finch, you will hear a series of tones, and the robot will show up in the purple “CONNECTED” section of the BlueBird Connector.

Now you are ready to start programming in Java! You can minimize the BlueBird Connector, but you should leave it open the entire time that you are using the Finch. If at any point you have trouble with your robot, you should come back to the BlueBird Connector to check your bluetooth connection. You can also check your battery level in the BlueBird Connector.

Using Java with Finch

You can use any offline Java IDE with the Finch. The screenshots here will show Eclipse as an example. Browser-based Java editors are not compatible with the Finch.

Download and unzip the Java library.

Create a new Java Project in Eclipse.

Name the project finch.

Eclipse will ask you if you want to create module-info.java. Click Don’t Create.

Next, right-click on the new project and select Import.

Select File System under General. Then click Next.

Click Browse and navigate to the BirdBrainJava folder. Make sure to click the checkbox next to the folder name to select all of the files. Then click Finish. If Eclipse asks you to overwrite files, answer Yes.

Eclipse will copy six files into your project: the classes for the Finch, Hummingbird and micro:bit (Robot.java, Finch.java, Hummingbird.java, and Microbit.java) and two test files (FinchTest.java and HummingbirdTest.java). Select these files in Eclipse and drag them into the src folder.

Once the files are in the src folder, open FinchTest.java. To test that everything is working properly, run the test program. The Finch’s beak should blink 10 times.

Now you are ready to start writing your own Java programs with the Finch! These lessons will help you to get started, and this reference summarizes the functions that are available in the Finch library.

Make sure to store your programs in the finch project so that they can find the Finch class. If you wish to create a new project, be sure to add the six files in the BirdBrainJava folder to the new project.