示例#1
0
def light_dim(level):
    if level <= 0 or level >= 6:
        return "Invalid Brightness"

    strip.off()
    strings.off()
    strings.on(level)
    # brightness = get_brightness()
    # string1.fadeIn(b)
    return f'DIM {level}'
示例#2
0
def allOff():
    strip.off()
    string1.off()
    string2.off()
示例#3
0
import time

from lightpi.hardware import strip, string1, string2

DELAY_SEC = 0.3

# Test the RGB Strip
strip.red()
time.sleep(DELAY_SEC)
strip.green()
time.sleep(DELAY_SEC)
strip.blue()
time.sleep(DELAY_SEC)
strip.off()

# Test the LED Strings
string1.on()
time.sleep(DELAY_SEC)
string1.off()
time.sleep(DELAY_SEC)
string2.on()
time.sleep(DELAY_SEC)
string2.off()

################################################################################
# Helper Methods
################################################################################


def allOn():
    strip.white()
示例#4
0
def light_off():
    strip.off()
    strings.off()
    return 'OFF'
示例#5
0
def light_on():
    strip.off()
    strings.on()
    return "ON"