Exemple #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.'
            )
Exemple #2
0
def on90():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((230, 230, 230));"
    )
Exemple #3
0
def on80():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((204, 204, 204));"
    )
Exemple #4
0
def on70():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((179, 179, 179));"
    )
Exemple #5
0
def on60():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((153, 153, 153));"
    )
Exemple #6
0
def on():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((255, 255, 255));"
    )
Exemple #7
0
def off():
    python3_run(
        "import board;import neopixel;pixels = neopixel.NeoPixel(board.D18, 16);pixels.fill((0, 0, 0));"
    )