Clone wiki

lightshowPi / Developer Tips

GPIO monitoring code for testing purposes

I've been using this for testing prior to hardware installation, audio/light sync, and testing modifications because my hardware is set up in a location other than the terminal into the Pi. ( I can't see the lightshow while tweaking parameters )

Not really an issue, but I wanted to share this little bit of code in the case it was needed by other developers. This would probably be of no concern to most users. :

def get_pins_values():
    pin_group = []
    for i in range(GPIOLEN):
        gpio_value = wiringpi.digitalRead(_GPIO_PINS[i])

    return pin_group : ( new file )

#!/usr/bin/env python

import time

import hardware_controller as hc

if __name__ == "__main__":

    while True:
        pinarr = hc.get_pins_values()
        print pinarr