Friday, July 05, 2019

would you like to see a toilet roll dance?



Making the jitterbug with the Hummingbird Bit was another fun project: challenging, quirky, achievable, with an engaging final product.

I do believe that the Hummingbird Bit creates the possibility of STEAM for the 99%

All I needed was a toilet roll, pipe cleaner, cardboard, Stanley knife and an eyelet punch. Everything else was supplied by the Hummingbird Bit Premium Kit: two position servos, 2 mono colour LEDS, one tri colour LED, one light sensor.

Instructions

One tricky bit was figuring out how the position servos were lined up and how to co-ordinate them. Since they go into opposite sides of the tube with rotors on the outside then the front position for one is at 180 degrees and the front position for the other is at 0 degrees.

This didn’t become clear to me until I wrote some code finding the initial positions with an A button press for one foot and a B button press for the other foot.
After that it wasn’t hard to get the feet moving. I used random over a range of 40 degrees to make the dance more unpredictable.

Coding the LEDs was straightforward. The tri colour LED, wrapped in a pipe cleaner, was for the antenna.

Finally, I added the light sensor to trigger the dance once the light faded. Here is the code which is triggered by placing your thumb over the light sensor:
Related: bee waggle project with the Hummingbird Bit

Afterword:
After finishing this project I left it set up and did other things. Later that day, hours later, as the light was fading I suddenly heard a noise and sensed some lights flashing. The jitterbug had begun to dance again as the light faded!

4 comments:

Lori Feldman said...

I am trying this out before having me students try it. I see no directions on where to connect the wires. I have also tried to copy your code. Any help would be greatly appreciated!
:0)
Lori

Bill Kerr said...

hi Lori,
The instructions are on the BirdBrain site, here
Cheers, Bill

Lori Feldman said...

I am sorry to be a bother...I used that to build the bot, but I see no instructions for wiring to the Hummingbird.
Ugh!
Lori

Bill Kerr said...

hi Lori,
Have you done the introductory tutorials? Go to this page, then select your system choices (mine were Hummingbird bit, Windows and MakeCode). Then it will take you to a page which has further choices. You then select the "Program" button which takes you to tutorials about how to wire up the relevant servo, LEDs, sensors.
Cheers, Bill