pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Puzzle

Example

Set the brightness of puzzle_0 to 20 and continuously display the configured hexagon matrix color.

from m5stack import *
from m5ui import *
from uiflow import *
import unit

puzzle_0 = unit.get(unit.PUZZLE, unit.PORTA, 64)
puzzle_0.setBrightness(20)
while True:
  puzzle_0.setColor(20, 0xff0000)
  wait_ms(2)

API

puzzle_0.setColor(1, 0xff0000)
  • Sets the RGB color of a specific LED (numbered 1 to 64). The color can be selected from the palette.
puzzle_0.setColorFrom(1, 5, 0xff0000)
  • Sets the RGB color of a group of LEDs (from LED 1 to 5). The color can also be selected from the palette.
puzzle_0.setColorAll(0xff0000)
  • Sets the RGB color of all LEDs.
puzzle_0.setBrightness(20)
  • Sets the overall brightness of the LEDs, with a range from 0 to 100.
puzzle_0.setShowLock(True)
  • Sets whether the lock display state is enabled.
puzzle_0.show()
  • Activates the currently configured RGB LED display.
puzzle_0.setColor(20, 0xff0000)
  • Sets the LED matrix color via an RGB color selector, adjusting the red, green, and blue values.
puzzle_0.setColor(20, 0xff0000)
  • Configures the LED matrix color by specifying numerical values for red, green, and blue, controlling the RGB settings.
On This Page