English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit Light

Example

Read the light intensity signal measured by the device

from m5stack import *
from m5stack_ui import *
from uiflow import *
import time
import unit

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
light_0 = unit.get(unit.LIGHT, unit.PORTB)

while True:
  print(light_0.digitalValue)
  print(light_0.analogValue)
  wait(0.2)
  wait_ms(2)

API

print((str('analog:') + str((light_0.analogValue))))
  • Obtain the output data of the analog signal
print((str('digital:') + str((light_0.digitalValue))))
  • Obtain the digital signal output data
Page Tools
PDF
On This Page