Print

BirdBlox Motor Mover

Create a program that remotely controls a servo motor using the BirdBlox app

Programming Language

BirdBlox

Subjects

Programming Tutorials

Grades

4-5, 6-8

Objective & Learning Goals

  • Control Hummingbird outputs
  • Use a tablet event (shaking) to trigger actions

Hummingbird setup

  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.

Programming steps

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