Discover: The Pi-Stop Python Module

My last PiStop workshop used a custom PiStop class which worked as follows:

#Example using
from pistop import *
import time
# Set PiStop in location A
with PiStop(hwSetup="A") as myPiStop:
  myPiStop.output(all,ON) #Switch all the lights ON
  pistop.output(G,OFF)    #Switch off the Green light

Assuming you have the file in the same directory as your own script, you can use the above code to control any Pi-Stop in any of the standard locations.


Standard Pi-Stop locations on a Raspberry Pi Model + or Model 2

By using the Pi-Stop python module, you can place the Pi-Stop on in the correct position on the GPIO header and use it!

You don’t need to remember the pin numbers in your code, just the location you’ve used.

There are a number of built in functions available to help new users, for example to see the positions of all the available Pi-Stop locations (for your specific Raspberry Pi) you can use the showSetup() function:

# Example show setups
from pistop import *

# Will show all possible locations
# Set PiStop in location A
with PiStop(hwSetup="A") as myPiStop:
  # Shall show position of location A only!



The Pi-Stop python module will continue to be developed to make it as easy as possible for beginners to program using the Pi-Stop.