EasyManua.ls Logo

Adafruit Feather M4 Express - Page 136

Adafruit Feather M4 Express
178 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
pixels[::2] = [YELLOW] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[1::2] = [GREEN] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[::2] = [TEAL] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[1::2] = [CYAN] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[::2] = [BLUE] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[1::2] = [PURPLE] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[::2] = [MAGENTA] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
pixels[1::2] = [WHITE] * (num_pixels // 2)
pixels.show()
time.sleep(wait)
def slice_rainbow(wait):
pixels[::6] = [RED] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
pixels[1::6] = [ORANGE] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
pixels[2::6] = [YELLOW] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
pixels[3::6] = [GREEN] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
pixels[4::6] = [BLUE] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
pixels[5::6] = [PURPLE] * (num_pixels // 6)
pixels.show()
time.sleep(wait)
def rainbow_cycle(wait):
for j in range(255):
for i in range(num_pixels):
rc_index = (i * 256 // num_pixels) + j
pixels[i] = wheel(rc_index & 255)
pixels.show()
time.sleep(wait)
RED = (255, 0, 0)
YELLOW = (255, 150, 0)
ORANGE = (255, 40, 0)
GREEN = (0, 255, 0)
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51 Page 141 of 183

Table of Contents

Related product manuals