Program

Print

Hummingbird Bit: BirdBlox Lessons

Getting Started
Using the Outputs
Using the Inputs

Setup

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

Setup

Step 1

This module will cover how to connect to the Hummingbird Bit and start programming in BirdBlox.

Step 2

Install BirdBlox onto your tablet or smartphone.

Step 3

Insert a micro:bit into your Hummingbird Bit Controller. The Hummingbird also needs a source of power, so connect it to the battery pack or AC power adapter. Connect your micro:bit to the computer with the USB cord.

Step 4

Download this file and drag it onto the micro:bit (you will need a computer with a USB port for this step). Your device should start to flash three letters on its display.

Download Hex File

Step 5

Remove the USB cord. You are ready to program wirelessly with BirdBlox!

Step 6

Open BirdBlox.

Tap New to create a new program.

Give your program a descriptive name.

Step 7

Tap the Hummingbird Connect button. Select Connect Device.

Tap the name of your device. To identify your device, look at the initials flashing on the micro:bit connected to the Hummingbird Bit. Match these to the Bit name on tablet.

When you connect to the Bit, you will hear the connection tone, and the initials will stop flashing. On the tablet screen, the dot on the Hummingbird Connect button will turn green, and the blocks for the Bit will turn teal.

Note: If you lose the connection to the Hummingbird, the initials will start to flash, the dot on the Hummingbird Connect button will turn red, and the blocks for the Bit will turn gray. If this happens, tap the Hummingbird Connect button, select Disconnect Device, and then reconnect.

Single Color LED

Step 1

This module will show you how to use a single color LED with the Hummingbird Bit. A single color LED is a small light with two wires. The colored wire shows the color of the LED. The Hummingbird kit comes with red, green, and yellow LEDS.

Step 2

Use the terminal tool to plug an LED into LEDS port 1 on the Bit. The colored wire should be connected to ‘+’ and the black to ‘-.’

Step 3

The Bit LED block is used to control a single color LED. To use this block, set the port of the LED to 1, 2, or 3 (BirdBlox defaults to port 1) and the brightness of the LED from 0% to 100%.

Step 4

When the green flag is tapped, the Bit LED is set to full brightness. Since the LED was never programmed to turn off, the light stays on at full brightness.

Reflect: What do you think would happen if you set the LED to 50% instead of 100%?

 

Step 5

Put the Bit LED block into a repeat forever loop. Add a wait block, a second Bit LED block, and another wait block to the forever loop. The wait block stops the program for a number of seconds.

Step 6

Each time through the loop, the program turns the LED on, pauses, turns the LED off, and pauses again. The forever loop repeats this process over and over.

Reflect: What do you think would happen if the bottom wait block was not there?

Step 7

Write a program that makes the LED blink faster. You will have to use decimal points.

Tri-Color LED

Step 1

This module will show you how to use a tri-color LED with the Hummingbird Bit. A tri-color LED is a small light with four wires. The tri-color LED actually has three tiny lights inside it. One is red, one is green, and one is blue. You can combine different amounts of red, green, and blue light to make different colors.

Step 2

Use the terminal tool to plug a tri-color LED into TRI-COLOR port 1 on the Bit. The red wire connects to ‘R,” the green to ‘G,’, the blue to ‘B,’ and the black to ‘-.’

Step 3

The Bit Tri-LED block is used to control a tri-color LED. To use this block, set the port of the LED to 1 or 2 (BirdBlox defaults to port 1) and the amount of red, green, and blue from 0% to 100%.

Step 4

When the green flag is tapped, red is set to full brightness. Since the tri-LED was never programmed to turn off, the red stays on at full brightness.

Reflect: What do you think would happen if you set both red and blue to 100?

Step 5

Put the Bit Tri-LED block into a repeat forever loop. Add a wait block, a second Bit Tri-LED block, and a second wait block to the forever loop. The wait block stops the program for a number of seconds.

Step 6

Each time through the loop, the program turns the LED red, pauses, turns the LED blue, and pauses again. The forever loop repeats this process over and over.

Reflect: How can you use a tri-color LED in a robot?

Step 7

Write a program that changes the color of the LED from purple to teal to green.

LED Screen

Step 1

In this module, you will learn to display icons and patterns on the screen of the micro:bit.

Step 2

Use the Bit Display block to display a small picture on the screen of the micro:bit. This pattern will make a happy face.

Step 3

When the green flag is tapped, the Bit Display is set to the image you created. Since the display was never programmed to turn off, the image remains on the screen.

Reflect: How would you change this code to display a different image?

Step 4

Put the Bit Display block into a repeat forever loop. Add a wait block, a second Bit Display block, and a second wait block to the forever loop. The wait block stops the program for a number of seconds.

Create a face with a different expression in the second Bit Display block.

Step 5

Each time through the forever loop, the program shows the first expression, pauses, shows the second expression and pauses again. The forever loop repeats this process over and over.

Reflect: How would you change the code to show 3 different expressions on the micro:bit?

Step 6

Use the Bit Display block to create a program that shows your very own animation.

Position Servo

Step 1

In this module, you will learn to use the position servo. The position servo is a motor that moves to a particular angle. The Hummingbird position servo can move to any angle from 0° to 180°.

Note: Hummingbird Base Kit users have an FS90 Micro Servo that works the same as the servo in these modules.

Step 2

Plug in the position servo to SERVOS port 1 on the Bit. Make sure the black wire is aligned to ‘-,’ the red wire to ‘+,’ and the white wire to ‘S.’

Step 3

The Bit Position Servo block is used to control the position servo. To use this block, set the port of the servo to 1, 2, 3, or 4 (BirdBlox defaults to port 1) and the angle from 0° to 180°.

Step 4

When the green flag is tapped, the Bit Position Servo is set to 90°. Since the servo was not programmed to move to any other position, it does not move again.

Reflect: Why do you think the position servo moves once, then stops at 90°? Would the servo move if it was already at 90° before you start the program?

Step 5

Put the Bit Position Servo in a repeat forever loop. Add a wait block, a second Bit Position Servo block, and a second wait block to the forever loop. The wait block stops the program for a number of seconds.

Step 6

Each time through the loop, the program moves the servo to 90°, pauses, moves the servo to 180°, and pauses again. The forever loop repeats this process over and over.

Reflect: How would the movement of the servo change if the wait blocks were set to .5 seconds instead of 1 second?

Step 7

Write a program that makes the position servo move to 3 different positions.

Rotation Servo

Step 1

In this module, you will learn to use the rotation servo. The rotation servo is a motor that can rotate at different speeds.

Step 2

Plug in the rotation servo to SERVOS port 1 on the Bit. Make sure the black wire is aligned to ‘-,’ the red wire to ‘+,’ and the white wire to ‘S.’

Step 3

The Bit Rotation Servo block is used to control the rotation servo. To use this block, set the port of the servo to 1, 2, 3, or 4 (BirdBlox defaults to port 1) and the speed from -100% to 100%.

Step 4

When the green flag is tapped, the Bit Rotation Servo is set to full speed. Since the servo was not programmed to stop, it keeps spinning.

Reflect: What would happen if you set the Bit Rotation Servo speed to -100% instead?

Step 5

Put the Bit Rotation Servo in a repeat forever loop. Add a wait block, a second Bit Rotation Servo block, and a second wait block to the forever loop. The wait block stops the program for a number of seconds.

Step 6

Each time through the loop, the program turns the motor on, pauses, turns the motor off, and pauses again. The forever loop repeats this process over and over.

Reflect: What do you think would happen if you changed the speed in the second Bit Rotation Servo block to 40 instead of 0?

Step 7

Write a program that makes the servo spin counterclockwise quickly for 1 second, then clockwise slowly for 3 seconds.

Buzzer

Step 1

This module will show you how to program the buzzer output on the Hummingbird Bit. The buzzer can be used to create different musical tones that come directly from the Hummingbird controller board. The range of the buzzer is 32 to 135. This range uses the same MIDI note numbers as Scratch and Snap!.

Step 2

Drag out the Bit Play Note __ for __ Beats block from the Robots folder and attach to a when Green Flag tapped block. Drag out a second Bit Play Note block and change the note. Drag out a third Bit Play Note block and change the note.

The range of the buzzer is 32 to 135. These numbers are MIDI note numbers.

Step 3

The notes you’ve programmed will play for 1 beat, one right after another. In music, the “beat” represents how long a note will play. We’ll learn to speed this up and slow this down next.

Reflect: How could you make the notes play for longer?

Step 4

To make the notes play faster or slower, use the set tempo to __ bpm block, located in the Sound folder. Snap the set tempo to __ bpm block into the top of your script.

The “tempo” is the speed of a song. It is measured in beats per minute (bpm). BirdBlox defaults to 60 bpm. Change the tempo by clicking the white oval and typing in a new tempo.

Step 5

Using a bit of math, we can figure out that a song with 120 bpm has beats that last half a second (120 bpm / 60 seconds in a minute = 2 beats in each second). Click the white oval to change the bpm and see how that affects the speed of the notes.

Reflect: What would you set the bpm to make a song where each beat = 1 second?

Step 6

Next, drag out 2 rest for __ beats block, located in the Sound folder. Place one rest for __ beats block after each Bit Play Note blocks. These blocks will cause there to be a silence, called a “rest.” Click the white oval to adjust the length of each rest.

Step 7

The notes you’ve programmed will now play with silences or “rests” in between them. You can now program your Hummingbird to play any song at any tempo!

Step 8

Can you write a program to play a simple song you know?

Light Sensor

Step 1

This module will show you how to use a light sensor as an input with the Hummingbird Bit. A light sensor is a component that collects data based on how much light surrounds the sensor. The range of the light sensor is 0 to 100.

This module assumes that you have already completed the single color LED module.

Step 2

Plug a sensor into your board. Any Hummingbird sensor can be connected to any of the three ports labelled “SENSORS” on the Bit. The yellow wire connects to ‘S,’ the red to ‘+,’ and the black to ‘-.’

Step 3

Find the Bit Sensor block near the bottom of the Robots folder. Use the drop-down menu to select “Light.”

To see the value of the sensor in BirdBlox, simply click on the Bit Sensor block.

Reflect: How can you make the value of the sensor higher or lower?

Step 4

You can use the sensor data to control the brightness of an LED.

Plug an LED into LED port 1.

Step 5

Place a Bit Sensor block inside a Bit LED block.

Step 6

The Bit Sensor block measures the value of the sensor and sets the LED brightness to that value.

Reflect: In this program, the micro:bit runs the Bit LED block about 25 times per second. What do you think would happen if you added a wait block to the repeat forever loop?

Step 7

Your light sensor value can be used to make decisions. To turn on an LED when the value of the sensor is low, use an if else block from the Control folder. This block requires a comparison block, which is in the Operators folder.

Step 8

This program compares the value of the light sensor to 10. If the sensor value is less than 10, the program runs the block inside the if section of the if else, and the LED turns on. When the sensor value is greater than 10, the program runs the block inside the else section, turning the LED off.

Step 9

Can you make an LED turn on and off with a different sensor? Disconnect the sensor you’ve been using and connect a new sensor. Use the drop-down menu in the Hummingbird Sensor block to make the block match your new sensor.

Dial Sensor

Step 1

This module will show you how to use a dial sensor as an input with the Hummingbird Bit. A dial sensor is a component that collects data based on how much you rotate the knob. The range of the dial sensor is 0 to 100.

This module assumes that you have already completed the single color LED module.

Step 2

Plug a sensor into your board. Any Hummingbird sensor can be connected to any of the three ports labelled “SENSORS” on the Bit. The yellow wire connects to ‘S,’ the red to ‘+,’ and the black to ‘-.’

Step 3

Find the Bit Sensor block near the bottom of the Robots folder. Use the drop-down menu to select “Dial.”

To see the value of the sensor in BirdBlox, simply click on the Bit Sensor block.

Reflect: How can you make the value of the sensor higher or lower?

Step 4

You can use the sensor data to control the brightness of an LED.

Plug an LED into LED port 1.

Step 5

Place a Bit Sensor block inside a Bit LED block.

Step 6

The Bit Sensor block measures the value of the sensor and sets the LED brightness to that value.

Reflect: In this program, the micro:bit runs the Bit LED block about 25 times per second. What do you think would happen if you added a wait block to the repeat forever loop?

Step 7

Your dial sensor value can be used to make decisions. To turn on an LED when the value of the sensor is high, use an if else block from the Control folder. This block requires a comparison block, which is in the Operators folder.

Step 8

This program compares the value of the dial sensor to 50. If the sensor value is greater than 50, the program runs the block inside the if section of the if else, and the LED turns on. When the sensor value is less than 50, the program runs the block inside the else section, turning the LED off.

Step 9

Can you make an LED turn on and off with a different sensor? Disconnect the sensor you’ve been using and connect a new sensor. Use the drop-down menu in the Hummingbird Sensor block to make the block match your new sensor.

Distance Sensor

Step 1

This module will show you how to use a distance sensor as an input with the Hummingbird Bit. A distance sensor is a component that collects data based on how close or far you are to the sensor. The range of the distance sensor is 1 to 260 cm.

The distance sensor is not included in the Hummingbird Bit Base Kit.

This module assumes that you have already completed the single color LED module.

Step 2

Plug a sensor into your board. Any Hummingbird sensor can be connected to any of the three ports labelled “SENSORS” on the Bit. The yellow wire connects to ‘S,’ the red to ‘+,’ and the black to ‘-.’

Step 3

Find the Bit Sensor block near the bottom of the Robots. Use the drop-down menu to select “Distance.”

To see the value of the sensor in BirdBlox, simply click on the Bit Sensor block.

Reflect: How can you make the value of the sensor higher or lower?

Step 4

You can use the sensor data to control the brightness of an LED.

Plug an LED into LED port 1.

Step 5

Place a Bit Sensor block inside a Bit LED block.

Step 6

The Bit Sensor block measures the value of the sensor and sets the LED brightness to that value.

Reflect: In this program, the micro:bit runs the Bit LED block about 25 times per second. What do you think would happen if you added a wait block to the repeat forever loop?

Step 7

Your distance sensor value can be used to make decisions. To turn on an LED when the value of the sensor is low, use an if else block from the Control folder. This block requires a comparison block, which is in the Operators folder.

Step 8

This program compares the value of the distance sensor to 15. If the sensor value is less than 15, the program runs the block inside the if section of the if else, and the LED turns on. When the sensor value is greater than 15, the program runs the block inside the else section, turning the LED off.

Step 9

Can you make an LED turn on and off with a different sensor? Disconnect the sensor you’ve been using and connect a new sensor. Use the drop-down menu in the Hummingbird Sensor block to make the block match your new sensor.

Sound Sensor

Step 1

This module will show you how to use a sound sensor as an input with the Hummingbird Bit. A sound sensor is a component that collects data based on how much sound surrounds the sensor. The range of the sound sensor is 0 to 100.

The sound sensor is not included in the Hummingbird Bit Base Kit.

This module assumes that you have already completed the single color LED module.

Step 2

Plug a sensor into your board. Any Hummingbird sensor can be connected to any of the three ports labelled “SENSORS” on the Bit. The yellow wire connects to ‘S,’ the red to ‘+,’ and the black to ‘-.’

Step 3

Find the Bit Sensor block near the bottom of the Robots folder. Use the drop-down menu to select “Sound.”

To see the value of the sensor in BirdBlox, simply click on the Bit Sensor block.

Reflect: How can you make the value of the sensor higher or lower?

Step 4

You can use the sensor data to control the brightness of an LED.

Plug an LED into LED port 1.

Step 5

Place a Bit Sensor block inside a Bit LED block.

Step 6

The Bit Sensor block measures the value of the sensor and sets the LED brightness to that value.

Reflect: In this program, the micro:bit runs the Bit LED block about 25 times per second. What do you think would happen if you added a wait block to the repeat forever loop?

Step 7

Your sound sensor value can be used to make decisions. To turn on an LED when the value of the sensor is high, use an if else block from the Control folder. This block requires a comparison block, which is in the Operators folder.

Step 8

This program compares the value of the sound sensor to 70. If the sensor value is greater than 70, the program runs the block inside the if section of the if else, and the LED turns on. When the sensor value is less than 70, the program runs the block inside the else section, turning the LED off.

Step 9

Can you make an LED turn on and off with a different sensor? Disconnect the sensor you’ve been using and connect a new sensor. Use the drop-down menu in the Hummingbird Sensor block to make the block match your new sensor.

Buttons

Step 1

This module will show you how to program the A and B buttons on the micro:bit to control the single color LED output of the Hummingbird Bit. The micro:bit’s A and B buttons can be used as inputs. Pressing them can be an “event” to trigger other actions.

This module assumes that you have already completed the single color LED module.

Step 2

Plug in a single color LED. The A and B buttons are located on the face of the micro:bit. They can be pressed one at a time or together.

Step 3

From the Control folder, drag out a when green flag tapped block, and attach a repeat forever loop. Drag an if statement into the forever loop. From the Robots folder, drag out a Bit button A block and place it in the hexagon of the if statement. Drag a Bit LED block into the if statement and set it to 100%.

Step 4

The A button being pressed causes the Hummingbird LED to turn on.

Reflect: How could you use the A button to turn a tri-color LED red?

Step 5

Duplicate the if Bit Button A loop and insert it into the forever loop below the first one. Use the drop down menu to change Button A to Button B. Program the Bit LED to turn off when the B button is pressed.

Step 6

The A and B buttons now turn the LED on and off respectively.

Step 7

Can you use a green and block to make the LED blink 4 times when the A button and B button are pressed at the same time?

Accelerometer

Step 1

This module will show you how to use the accelerometer as an input to control the tri-color LED from the Hummingbird. The range of the x, y, and z variables on the accelerometer is -10 to +10 m/s^2.

This module assumes that you have already completed the tri-color LED module.

Step 2

Plug in the tri-color LED. You do not need to attach the accelerometer. The accelerometer is built into the micro:bit.

Step 3

From the Control folder, drag out a when green flag tapped block, repeat forever loop, and if statement block, and connect them with the if statement inside the repeat forever loop.

Nest a Bit Screen Up block from the Robots folder into the hexagon space of the if statement. Use the drop down menu to select “Shake.”

Drag out 2 Bit Tri-LED blocks from the Robots folder, and 1 wait block from the Control folder. Write a program to turn the tri-color LED red, wait 1 second, and turn off when the micro:bit is shaken.

Step 4

When you shake the Hummingbird controller board, your tri-color LED will turn red for 1 second, then turn off.

Reflect: How could you make the tri-color LED blink red and blue 3 times when the micro:bit is shaken, then turn off? (Hint: Look in the Control folder for a loop!)

Step 5

You can also tilt your Hummingbird Bit in different directions to change colors of the tri-color LED.

First, delete the wait and second Bit Tri-LED blocks. Select the drop down menu in the Bit Shake block, and change it to read “Bit Logo Up.” Duplicate the if statement. Then, click the second drop down menu to select “Bit Logo Down.” Change the second Bit Tri-LED to 100% green.

Step 6

When you tilt the Hummingbird Bit controller forward and back, the tri-color LED will change color from red to green.

Reflect: How could you make this code control a position servo to go from 0 to 180 degrees?

Step 7

Write a program that makes the tri-color LED turn blue and purple when the Hummingbird Bit is tilted left and right.

Step 8

While we’ve been using the accelerometer as an event up to this point, you can also use the accelerometer’s value to slowly alter a component by nesting it, which you can also do with sensors.

First, save 1 Bit Tri-LED block, but delete everything else inside the repeat forever loop. Nest a Bit Accelerometer block inside the Bit Tri-LED “R” oval. The range of the accelerometer is -10 to +10 m/s^2.

Step 9

Reflect: How could you make the y variable of the accelerometer control the brightness of the blue of the tri-color LED at the same time?

Step 10

Write a program that:
– Makes the x variable of the accelerometer control the brightness of the red of the tri-color LED.
– Makes the y variable of the accelerometer control the brightness of the blue of the tri-color LED.
– Makes the z variable of the accelerometer control the brightness of the green of the tri-color LED.

Compass

Step 1

This module will show you how to use the compass as an input to control the movement of a Hummingbird position servo. The range of the compass is 0° to 359°.

This module assumes that you have already completed the position servo module.

Step 2

First, we must calibrate the compass. To do this, click the settings icon in the top left corner and click “Calibrate Compass.” Select your Hummingbird. When prompted, tilt your Hummingbird every direction in the air. If successfully calibrated, a check mark will appear on both the LED screen and next to your Hummingbird’s name. If unsuccessful, try again.

Step 3

Check your Hummingbird’s calibration by dragging out a Bit Compass block from the Robots folder. Click the block to read the sensor value. Redirect your Hummingbird and click the block again. Repeat this process to see the different headings, from 0-360º.

Reflect: What number represents South?

Step 4

Plug in the position servo. You do not need to attach the compass. The compass is built into the micro:bit.

Step 5

From the Control folder, drag out a when green flag tapped and a repeat forever loop. From the Robots folder, drag a Bit Position Servo block into the repeat forever loop. From the Robots folder, nest the Bit Compass block into the Bit Position Servo block.

Step 6

The position servo will now rotate to match the compass heading. Although the range of the compass is 0°-359°, the position servo will stop at 180 degrees, because the range of the position servo is 0°-180°.

Reflect: How could you use the compass to control the brightness of a single color LED?

Step 7

The compass value can also be used to make decisions. We will now set your position servo to either 0 or 180 degrees based on the compass value.

First, drag the Bit Compass and Bit Position Servo blocks apart and outside of the repeat forever loop. Drag an if else block from the Control folder into the repeat forever loop. Nest a less than block from the Operators folder into the hexagon space of the if else block. Nest the Bit Compass block into the first space of the less than block. Set the threshold to 180 degrees.

Drag the Bit Position Servo block into the first open space of the if else block and set it to “0.” Drag another Bit Position Servo block into the second open space of the if else block and set it to “180.”

Step 8

This program compares the value of the compass to 180. If the compass value is less than 180 (indicating west), the program runs the block inside the position servo is set to 0 degrees. When the compass value is greater than 180 (indicating east), the position servo is set to 180 degrees.

Reflect: How could you use a similar code to turn a tri-color LED red and blue based on the value of the compass?

Step 9

What kind of robot could you build that would respond to data from the compass?

Multiple Devices

Step 1

This module will show you how to connect multiple devices through the BirdBlox App. It will also show you how to control the outputs of one Hummingbird with the inputs of another, wirelessly. For this module, you will need 2 Hummingbird Bit boards*, 1 tri-color LED, and 1 dial sensor.

This module assumes that you have already completed the tri-color LED, buttons, and sensor modules.

*In steps 2-7, you will be using a micro:bit by itself without a Hummingbird controller board. To power this micro:bit, you can either use a AAA battery pack or the USB cord included in your kit.

Step 2

Plug in the tri-color LED into port 1. You will also need a separate micro:bit unplugged from a Hummingbird, which you can power by a USB cable or AAA battery pack (not included). We will be using a battery pack.

Step 3

We will begin by connecting 2 devices to the BirdBlox App. We will first be connecting a Hummingbird Bit and also a micro:bit by itself.

First, select the Hummingbird Connect button in the top left of the BirdBlox screen. Select “Connect Multiple.” Select the + icon to connect devices. Connect the Hummingbird first. Then connect the micro:bit. Select “Done.”

Step 4

We will now program the sending and receiving components of the robots. We will write a program that changes the color of a tri-color LED using the micro:bit’s A and B buttons.

From the Control folder, drag out a when green flag tapped block, repeat forever loop, and if statement block, and connect them with the if statement inside the repeat forever loop.

Go to the Robots folder, and minimize the Hummingbird Bit blocks by touching the small arrow. Maximize the micro:bit blocks by touching the small arrow. Nest a micro:bit Button A block into the hexagon space of the if statement block.

Minimize the micro:bit blocks and maximize the Hummingbird Bit blocks. Drag our a Bit Tri-LED block into the open space of the if statement. Change the Bit Tri-LED to 100% red.

Step 5

When the A button is pressed on the mircro:bit, the tri-color LED on the Hummingbird turns red.

Reflect: Could you write a similar script to make a message or picture appear on the LED screen of the Hummingbird when you press the A button on the micro:bit?

Step 6

Now we want to program our robots so that pressing the A and B buttons on the micro:bit will turn the Hummingbird tri-color LED red and blue.

First, duplicate the if statement containing micro:bit button A and place it below the first if statement within the repeat forever loop. Change it to micro:bit button B, and change second Bit Tri-LED to 100% blue.

Step 7

When the A button is pressed on the micro:bit, the Hummingbird tri-color LED turns red. When the B button is pressed on the micro:bit, the Hummingbird tri-color LED turns blue.

Reflect: Could you do something similar with a position servo, setting it to either 0 or 180 degrees based on which button is pressed?

Step 8

Disconnect the micro:bit from the BirdBlox App by clicking the Hummingbird Connect button in the top left and pressing the X next to your micro:bit. The micro:bit will resume flashing 3 letters. Plug this micro:bit into a Hummingbird controller board. Then plug a dial sensor into Sensor port 1. Connect the second Hummingbird using the Hummingbird Connect button.

We will call the first the Hummingbird you were using HB1. The Hummingbird you just connected will be HB2.

Step 9

Now we’re going to program a dial sensor on HB2 to control the tri-color LED on HB1.

First, delete everything but the when green flag tapped and repeat forever blocks. From the Control folder, drag an if else statement into the repeat forever loop. From the Operators folder, nest a less than block into the hexagon shape of the if else statement. From the Robots folder, nest a Bit Light sensor block into the first open space in the less than block. Use the first drop down menu to select “Bit 2” (meaning HB2), and use the second drop down menu to select “Dial.” Set the threshold to 50.

Drag a Bit Tri-LED block into the first open space and set it to 100% red. Drag another Bit Tri-LED block into the “else” space and set it to 100% blue. Leave both Bit Tri-LED blocks set to Bit 1.

Step 10

When you turn the dial above 50% on HB2, the tri-color LED on HB1 turns blue. When you turn the dial below 50% on HB2, the tri-color LED on HB1 turns red.

Reflect: Could you recreate this same function with a different sensor?

Step 11

Now we will use the dial on HB2 to control the brightness of the tri-color LED on HB1 in real time.

Save the Bit 2 Dial block and the Bit 1 Tri-LED block. Delete everything else inside the forever loop. Drag the Bit 1 Tri-LED block into the forever loop. Nest the Bit 2 Dial block into the “R” space on the Bit 1 Tri-LED block.

Step 12

As you turn the dial sensor on HB2, the brightness of the tri-color LED on HB1 will increase and decrease in real time.

Reflect: How could you make the dial also control the brightness of the blue light in the tri-color LED?

Step 13

Combining skills and components like accelerometer, compass, and motors can make for some great animatronic and puppeteering projects. What sort of animatronic puppet could you make, controlled by multiple devices?