RGB Lights
The StudioBot has 4 RGB lights under the display. We can use these lights to show colours and signal output to the user.
import time
import board
import neopixel
pixel_pin = board.NEOPIXEL
num_pixels = 4
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
pixels.fill(RED)
pixels.show()
time.sleep(2)
pixels.fill(GREEN)
pixels.show()
time.sleep(2)
pixels.fill(BLUE)
pixels.show()
Last updated