Cart 0

Ryanteck SnowPi - Test Program

The following code will blink each LED one at a time.

GPIO Zero Setup Instructions can be found here

You can run this code by putting it into a python file and then running it with python.

#SnowPi Test Code

import random

import time

from gpiozero import LED

#Setup all the LEDs

 

led7 = LED(7)

led8 = LED(8)

led9 = LED(9)

led17 = LED(17)

led18 = LED(18)

led22 = LED(22)

led23 = LED(23)

led24 = LED(24)

led25 = LED(25)

 

led7.off()

 

led8.off()

 

led9.off()

 

led17.off()

 

led18.off()

 

led22.off()

 

led23.off()

 

led24.off()

 

led25.off()

 

while True:

	led7.toggle()

	time.sleep(1)

	led8.toggle()

	time.sleep(1)

	led9.toggle()

	time.sleep(1)

	led17.toggle()

	time.sleep(1)

	led18.toggle()

	time.sleep(1)

	led22.toggle()

	time.sleep(1)

	led23.toggle()

	time.sleep(1)

	led24.toggle()

	time.sleep(1)

	led25.toggle()

	time.sleep(1)


Older Post Newer Post

Related Posts

VESA-Pi Assembly Guide
VESA-Pi Assembly Guide
14th September 2013 The VESA-Pi Raspberry Pi case is the perfect case for those wanting to quickly clip your Raspberr...
Read More
Using GPIO Zero with the PumpkinPi
Using GPIO Zero with the PumpkinPi
    It's that time of year... the ghosts and ghouls are out in force, pumpkins are being carved and witches are prepa...
Read More
Using a UBEC with a Raspberry Pi
Using a UBEC with a Raspberry Pi
Hooking up your UBEC to your Raspberry Pi really couldn't be easier. Simply plug in the 3 pin socket to your Raspberr...
Read More