BirdBlox Project 1: Motor Mover
Description: Create a program that remotely controls a servo motor using the BirdBlox app.
Programming Concepts: Controlling Hummingbird outputs, using a tablet event (shaking) to trigger events.
Materials: Hummingbird Controller, Hummingbird BLE Adapter, Compatible table, One servo
Approx. Time: 10 Minutes
1. Attach a servo to servo port 1.
2. If you have not already, attach the Hummingbird BLE adapter using the instructions here.
3. Attach the external power cable.
1. Open the BirdBlox app and connect to your Hummingbird.
2. Tap Control to open the control category. Remember, if you have difficulty selecting the buttons, you can zoom to make the buttons larger.
3. The program should start when the green flag is tapped. Drag a when flag clicked block to the middle of the screen.
4. Attach a repeat forever block below it. This will allow us to repeatedly change the servo's position.
5. We want the servo to move only if the user shakes the tablet, so place an if block inside the forever loop.
6. Select the Tablet menu.
7. Move the Device Shaken block into your if block. When the user shakes the device, the program will run the blocks inside the if block.
8. Select the Hummingbird menu and place a Hummingbird Servo block inside of the forever loop. The servo should move to 90° when the user shakes the tablet.
9. After one second, the servo should return to 0°. The wait block is on the Control menu.
10. Test your program! When you shake the tablet, the servo should move to 90° and then back to 0°.