ImagiCharm Level 1

ImagiCharm - Level 1

Duration: ~30 minutes Prerequisites: None (Beginner friendly)

Learn more about ImagiCharm | Project Gallery

Lesson 1: Moving Pixels

Let’s learn how to create colorful pixels on the ImagiCharm! You’ll light up individual pixels with different colors.

Step 1: Turn On a Pixel

Start by turning on one pixel with a specific color. Let’s make the first pixel red.

# Turn on the first pixel
pixels[0][0] = (255, 0, 0)  # Red
pixels.show()

Step 2: Try Other Colors

Change the color values to light up the pixel with green or blue.

pixels[0][0] = (0, 255, 0)  # Green
pixels.show()

pixels[0][0] = (0, 0, 255)  # Blue
pixels.show()

Step 3: Light Up More Pixels

Try lighting up more pixels with different colors!

pixels[1][2] = (255, 255, 0)  # Yellow
pixels[2][3] = (255, 0, 255)  # Magenta
pixels.show()

Combined Solutions & Animations

# Solution: Blink an LED on Imagicharm
pixels[0][0] = (255, 0, 0)  # Red
pixels.show()

Respond to Button Press

# Solution: Respond to button press
if button_a.is_pressed():
    pixels[0][0] = (0, 255, 0)  # Green
    pixels.show()

Display a Message

# Solution: Display a message
message = "Hello from Imagicharm!"
print(message)

Animation Example: Color Cycle

# Simple animation: cycle through colors
import time
colors = [(255,0,0), (0,255,0), (0,0,255)]
for color in colors:
    pixels[0][0] = color
    pixels.show()
    time.sleep(0.5)

Animation Example: Bouncing Pixel

# Animation: Bouncing pixel across the row
import time
for i in range(7):
    pixels.clear()
    pixels[0][i] = (0, 255, 255)  # Cyan
    pixels.show()
    time.sleep(0.3)

Project Info


Next: Level 2 – Programming Concepts Previous: Workshop Home

ImagiCharm

Thanks! We hope you found what you are looking for. Please feel free to contribute via Github.