Table of Contents

Random LED Glow on Quarky – Python

Example Description
The example demonstrates how to create a random colored LED pattern on Quarky in the Python Coding Environment.

Code

sprite = Sprite('Tobi')
quarky = Quarky()
import random

quarky.cleardisplay()

for x in range(1, 8):
  red = random.randrange(0, 255)
  green = random.randrange(0, 255)
  blue = random.randrange(0, 255)
  
  quarky.setled(x, 1, [red, green, blue], 100)

Output