English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit Color

Example

Get the RGB value of the color recognized by the device

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

setScreenColor(0x222222)
color_0 = unit.get(unit.COLOR, unit.PORTA)

while True:
  print((str('R:') + str(str((color_0.red)))))
  print((str('G:') + str(str((color_0.green)))))
  print((str('B:') + str(str((color_0.blue)))))
  wait_ms(2)

API

print(color_0.rawData)
  • get rawData
print(color_0.blue)
  • get Blue value
print(color_0.green)
  • get Green value
print(color_0.red)
  • get Red value
color_0.setGains(0x00)
  • set gain value
color_0.setIntegrationTime(0xFF)
  • set integration value
Page Tools
PDF
On This Page