NEW Hummingbird Bit: Snap! Lessons

Set Up (Start here)

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 9

Step 1

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

Step 2

Install the BlueBird Connector.

Step 3

Insert a micro:bit into your Hummingbird Bit Controller, 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.

Step 4

Download this file and drag it onto the micro:bit. Your device should start to flash three letters on its display.

Step 5

Remove the USB cord. You won’t need it to use Snap!

Insert the bluetooth dongle into a USB port.

Step 6

Open the BlueBird Connector and check that the bluetooth symbol has a green check beside it.

You may see one robot or many, depending on how many are nearby.

Click on the name of the robot that matches the initials on your device.

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.

Troubleshooting Note: The BlueBird Connector must remain open in the background the entire time that you are working with the Hummingbird. If your Hummingbird disconnects, the app will notify you, and the Hummingbird will begin flashing its initials again. If this happens, return to the BlueBird Connector and reconnect it.

Step 7

You are ready to begin programming! Click Open Snap!.

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 Hummingbird 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 (Snap! defaults to port 1) and the brightness of the LED from 0% to 100%.

Step 4

When the space bar is pressed, the Hummingbird 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 Hummingbird LED block into a repeat forever loop. Add a wait block, a second Hummingbird 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.

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 Hummingbird 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 (Snap! defaults to port 1) and the amount of red, green, and blue from 0% to 100%.

Step 4

When the space bar is pressed, 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 Hummingbird Tri-LED block into a repeat forever loop. Add a wait block, a second Hummingbird 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.

Step 1

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

Step 2

Use the micro: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 space bar is pressed, the micro: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 micro:bit Display block into a repeat forever loop. Add a wait block, a second micro: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 micro: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 micro:bit Display block to create a program that shows your very own animation.

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°.

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 Hummingbird 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 (Snap! defaults to port 1) and the angle from 0° to 180°.

Step 4

When the space bar is pressed, the Hummingbird 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 Hummingbird Position Servo in a repeat forever loop. Add a wait block, a second Hummingbird 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 servo move to 3 different positions.

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 Hummingbird 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 (Snap! defaults to port 1) and the speed from -100% to 100%.

Step 4

When the space bar is pressed, the Hummingbird Rotation Servo is set to full speed. Since the servo was not programmed to move to stop, it keeps spinning.

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

Step 5

Put the Hummingbird Rotation Servo in a repeat forever loop. Add a wait block, a second Hummingbird 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 Hummingbird 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.

Step 1

Hummingbird sensors measure different things, but they all work the same.

Hummingbird Bit base kits include a light sensor and a dial sensor, while other kits also include sound and distance sensors.

Step 2

Plug a sensor and an LED into your board. Any Hummingbird sensor can be connected to any of the three ports labelled “SENSORS” on the Bit. The yellow wire does to ‘S,’ the red to ‘+,’ and the black to ‘-.’ The videos show a light sensor, but you can use any sensor that you want!

Step 3

Find the Hummingbird sensor block under the Sensing menu. Use the drop-down menu to select the type of sensor that you are using.

To see the value of the sensor in Snap!, simply click on the Hummingbird sensor block.

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 Hummingbird sensor block inside a Hummingbird LED block.

Step 6

The Hummingbird 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 Hummingbird LED block about 25 times per second. What do you think would happen if you added a pause block to the forever loop?

Step 7

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

Step 8

This program compares the value of the sensor to 10. If the sensor value is less than 10, the program runs the block inside the then section of the if then 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.