Adafruit Feather M4 Express Manual page 136

Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Feather M4 Express and is the answer not in the manual?

Related Products for Adafruit Feather M4 Express

Table of Contents

Save PDF