pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

Atomic Base

UIFlow 1.0 Project

Earth

案例程序

打印Earth Unit检测的模拟和数字量
from m5stack import *
from m5stack_ui import *
from uiflow import *
import unit

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
earth_0 = unit.get(unit.EARTH, unit.PORTB)

while True:
  print((str('Analog Value:') + str((earth_0.analogValue))))
  print((str('Digital Value:') + str((earth_0.digitalValue))))
  wait_ms(2)

功能说明

earth_0.analogValue
  • 获取指定设备earth的模拟值
earth_0.digitalValue
  • 获取指定设备earth的数字值
On This Page