This section will show you how to use the Hummingbird with Java on Mac/Windows computers. Your computer must have Bluetooth capability to program the Hummingbird in Java.

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

Steps 1 2 3
Steps 1 2 3 4 5 6 7 8 9 10 11 12

This module will show you how to set up your Hummingbird to program in Java.

Insert a micro:bit into your Hummingbird Bit Controller (you might need to push a little harder than you think!), and connect it to the computer with the USB cord. The Hummingbird also needs a source of power, so connect it to the battery pack or AC power adapter.

Download this file and drag it onto the micro:bit. Your device should start to flash three letters on its display. You will only need to complete this step once for each Hummingbird – as long as your device is flashing its initials, you are ready to connect via Bluetooth.

After dragging the file onto the micro:bit, remove the USB cord. You won’t need it to use Java.

Download Hex File

This section will show you how to use an offline Java editor with the Hummingbird on Mac/Windows computers. Browser-based Java editors are not compatible with the Hummingbird.

You can use any offline Java editor with the Hummingbird, but if you don’t have a favorite, we suggest trying Eclipse. The screenshots here will show Eclipse as an example.

Next, install the BlueBird Connector. This software will handle the Bluetooth connection with the Hummingbird. You must run it in the background while you are programming the Hummingbird in Java.

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.

You will hear a sound as your device connects, and the initials will stop flashing on the device. The name of your robot should appear under Connected.

Create a new Java Project in Eclipse.

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

Select File System under General.

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.

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

Note: If you get an error in Eclipse, right-click on the src folder and select New/Package. Once you create a new package, drag the .java files into that package.

Once the files are in the src folder, open HummingbirdTest.java.

To test that everything is working properly, connect a single-color LED to port 1 of the Hummingbird. Run the test program and check that the single-color LED blinks 10 times.

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

Make sure to store your programs in the Hummingbird project so that they can find the Hummingbird and Microbit classes. If you wish to create a new project, be sure to add the four files in the BirdBrainJava folder to the new project.