CodeBug’s legs can be easily sewn to fabric. If you use conductive thread, you can connect sewable LEDs and buttons to the legs and use them in your programs.
|Micro USB cable|
CodeBug’s legs can be used to turn LEDs on and off. In this mode the legs are called outputs.
Thread your needle (get an adult to help you).
Tie a knot in at the other end.
Place your CodeBug on your fabric, face up.
Pierce the fabric with the needle from the underside of the fabric, up through the PWR leg then down through the fabric on the other side of the leg.
Repeat this 5 times so your thread has a good connection with the leg and making sure it will hold CodeBug in place.
Sew up and down through the fabric until you reach the position where you want your LED to go.
Sew the positive side of the LED (with the plus symbol) to the PWR leg on CodeBug. Then sew the negative end of the LED (with the minus symbol) to leg 0.
You may wish to sew the legs on the opposite side of CodeBug as well to make sure it is held to your fabric.
Control your LED
CodeBug’s legs are very sensitive, they can feel electricity passing through them. In this mode CodeBug’s legs are called inputs.
Buttons and switches work by controlling whether two contacts are connected or not. When the button is pushed, or the switch flicked on, the two sides are connected and electricity can flow, but in the off state no electricity will flow.
Sew your buttons in the same way you sewed the LEDs. Sew one ring of the button to the GND leg on CodeBug and the other ring to the leg 1 on CodeBug.