Exemplo n.º 1
0
import colorsys

RED = 0
YELLOW = 2
ORANGE = 1
GREEN = 3
BLUE = 4
WHITE = 5

INTENSITY = 30
saved_hue = 0
saved_white = 0
last_hue = 0

wpi.wiringPiSetup()
wpi.piGlowSetup(1)

def signal_handler(signal, frame):
	piglow_all_off()
	sys.exit(0)

def piglow_all_off():
	wpi.piGlowRing(YELLOW,0)
	wpi.piGlowRing(RED,0)
	wpi.piGlowRing(ORANGE,0)
	wpi.piGlowRing(BLUE,0)
	wpi.piGlowRing(GREEN,0)
	wpi.piGlowRing(WHITE,0)

def piglow_change_hue(hue):
	rgb = colorsys.hsv_to_rgb(hue/360.00, 1.0, 1.0)
Exemplo n.º 2
0
import colorsys

RED = 0
YELLOW = 1
ORANGE = 2
GREEN = 3
BLUE = 4
WHITE = 5

INTENSITY = 30
saved_hue = 0
saved_white = 0
last_hue = 0

wpi.wiringPiSetup()
wpi.piGlowSetup(1)


def signal_handler(signal, frame):
    piglow_all_off()
    sys.exit(0)


def piglow_all_off():
    wpi.piGlowRing(YELLOW, 0)
    wpi.piGlowRing(RED, 0)
    wpi.piGlowRing(ORANGE, 0)
    wpi.piGlowRing(BLUE, 0)
    wpi.piGlowRing(GREEN, 0)
    wpi.piGlowRing(WHITE, 0)
Exemplo n.º 3
0
import wiringpi2 as wiringpi
import signal
import sys
import colorsys
from math import floor
io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS)
wiringpi.piGlowSetup(1)

RED = 0
YELLOW = 1
ORANGE = 2
GREEN = 3
BLUE = 4
WHITE = 5

INTENSITY = 30

def signal_handler(signal, frame):
	wiringpi.piGlowRing(YELLOW,0)
	wiringpi.piGlowRing(RED,0)
	wiringpi.piGlowRing(ORANGE,0)
	wiringpi.piGlowRing(BLUE,0)
	wiringpi.piGlowRing(GREEN,0)
	wiringpi.piGlowRing(WHITE,0)
	sys.exit(0)

signal.signal(signal.SIGINT, signal_handler)

#wiringpi.piGlowRing(WHITE,255)

while True: