Ejemplo n.º 1
0
def fill(r, g, b):
    if is_int(r) and is_int(g) and is_int(b):
        if r >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255:
            python3_run(
                "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill(("
                + str(r) + ", " + str(g) + ", " + str(b) + "));")
        else:
            raise ValueError(
                'The RGB parameter is not an integer type, or the RGB parameter value does not range from 0 to 255.'
            )
Ejemplo n.º 2
0
def on90():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((230, 230, 230));"
    )
Ejemplo n.º 3
0
def on80():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((204, 204, 204));"
    )
Ejemplo n.º 4
0
def on70():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((179, 179, 179));"
    )
Ejemplo n.º 5
0
def on60():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((153, 153, 153));"
    )
Ejemplo n.º 6
0
def on():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((255, 255, 255));"
    )
Ejemplo n.º 7
0
def off():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((0, 0, 0));"
    )