# Attaching a Push Button Lesson

**UNPLUG batteries AND/OR Disconnect from computer. Get 2 alligator clips and 1 push button**

![](https://2507214486-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpUPSf3tCxHePJxNjfg%2F-Lpie7Iu-VATS8ShBJju%2F-LpieCpbQ0bt9LH_rSoQ%2FCapture.PNG?alt=media\&token=e9af87f4-494c-4638-b42a-6a2d1527ffe0)

Attach the Ground wire to prong A of button and then to the GRD PIN on your micro bit

**TIP**: Be careful the prongs are fragile

Attach the 2nd clip to prong B of the button and then to PIN 0 on your microbit

![Why is this crooked?](https://2507214486-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpUPSf3tCxHePJxNjfg%2F-Lpie7Iu-VATS8ShBJju%2F-LpieN1JpKOFTNu5nX9h%2FIMG_0469.jpg?alt=media\&token=a8c18177-7e28-4e14-bcac-1b105e750263)

**Programming the push button: When the button is pushed we want ONE LED light to show**

```
Forever
    if PIN 0 is pressed
        show 1 LED in middle of screen
    else
        show no lights on led screen
```

**TIP**: &#x20;

![](https://2507214486-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpUPSf3tCxHePJxNjfg%2F-Lpie7Iu-VATS8ShBJju%2F-LpifEJTdSjvWMUyoeBB%2FCapture.PNG?alt=media\&token=bd2c41c7-80aa-4f98-9252-50710750f3a6)

These instructions are based on a lesson found at <http://www.teachwithict.com/pushbtton.html>
