Donation Robot Version 2
(Using the WuKong breakout board instead of the Hummingbird Bit controller)
- 1 – micro:bit board
- 1 – WuKong Elecfreaks micro:bit breakout board
- 1 – standard servo
- 1 – VEX steel spring limit switch
- 2 – F to F single-wire jumper wire
- 1 – LED with 100 ohm resistor already wired in series
- 1 – Medium size paper or plastic box
Micro:bit & Breakout Board Assembly
- Completely charge your breakout board.
- Plug microbit board into breakout board so that the microbit LED display is facing away from the center of the breakout board
- Put a either a round, four arm, six arm servo horn onto your servo with the screw that comes with it.
- Attach a small empty thread spool to the servo arm with hot glue, centering it on top of the servo horn.
- Attach a 12” length of thread onto the spool with a drop of hot glue.
- Wind the thread around the spool for now.
- Plug the servo into servo pin set S0 on the breakout board making sure that the black or brown wire is plugging into the black (“G”) side of the three pins.
Limit Switch Assembly
- Cut the spring on the limit switch with a hacksaw so that it is slightly shorter than the coin that you intend to use.
- Round the sharp edges of the limit switch spring.
- Plug the black pin of the limit switch cable into one of the female to female jumper wire.
- Plug the white pin of the limit switch cable into the remaining female to female jumper wire.
Donation Robot Assembly
- Mount the microbit / breakout board assembly on the top of the box with some hot glue.
- Cut a small hole in the box for coins.
- Mount the limit switch under the hole that you just cut out so that when a coin is put into the hole, the limit switch closes. (The limit switch acts as a sensor so that the robot knows when it has gotten a coin.
- Mount the servo motor on the side of the box, hanging over the edge, so that the string is dangling.
- On your computer open Chrome and navigate to: https://makecode.microbit.org/#editor
- Add the WuKong Elecfreaks extension by 1. clicking “Extensions” in the code area, 2. search for “WuKong”, 3. Click on the “wokong” link. (The WuKong extension will be added and this will give you the code for the servomotor.
- Go back to the microbit editor in chrome: https://makecode.microbit.org/#editor
- Drag and drop the program / code into place as shown in the drawing.
- Pay attention to all of the settings on each line of drag and drop code—especially the pin numbers and the numerical amounts
- Ensure that the breakout board is fully charged.
- Plug the breakout board into the computer.
- Select “Connect Device” from the Setting (the gear) menu on the web page.
- Connect to your microbit/breakout board assembly.
- Download the program using the “Download” button on the web page.
- Test your robot by dropping in a coin into the slot that you cut in the box. If you did everything right, you should see a hear, a smile, some happy music, and the servo motor will turn, winding up the string.