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