Tag Archives: GPIO

A simple switch with the Raspberry Pi and Scratch GPIO

This is a simple switch without pull up resistors as these are already enabled in the program.

You need 2 wires. Connect 1 wire to 3.3v (Pin 1) and another wire to an INPUT Pin (5,7,8, 10,19 ,21,22,23 24,26)

You need to connect a switch / button between the 2 wires.

pushuppi_bb

In this program, I have “asked” the Scratch cat to say the sensor value of Pin 7. It is normally LOW (0) but when they connect, it goes to HIGH (1).

pinlow

Connect the wires.

pinhigh

You can now use the Pin7 sensor value as a control value in the program to trigger events.