Foil Switch

We can use our microbit and attached basic:bit along with some aluminum foil and a few wires to use microbit pin 1 as an external switch. (If you haven't done so already, see the separate instructions on hooking up the basic:bit.)

Foil Switch Hookup

Tape two pieces of aluminum foil to a folded piece of paper as shown. Each piece of aluminum foil should wrap around to the inside of the paper, but not touch the foil on the opposite side except when the paper is pushed closed.

Get two small hookup wires that are female on one end and male on the other.

  1. Attach the female ends as shown to pin 1 and to G (ground).

  2. Attach alligator clips to the other ends.

  3. Attach the other end of each alligator clip to one of the pieces of aluminum foil. It doesn't matter which one goes to which piece of foil.

Program

Use a while loop to display some LED pattern when the pin 1 to Ground circuit is completed by pressing the paper so that the opposite pieces of foil touch each other, as shown below left.

LED lights up


Waving

If you have time, get your program to wave back and forth using the switch. Pressing it causes the hand to wave to the right, and releasing it causes the hand to move back left.