pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Color

案例程序

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)

功能说明

print(color_0.rawData)
  • 获取原始数据
print(color_0.blue)
  • 获取Blue值
print(color_0.green)
  • 获取Green值
print(color_0.red)
  • 获取Red值
color_0.setGains(0x00)
  • 设置高光区域
color_0.setIntegrationTime(0xFF)
  • 设置融合时间
On This Page