English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit Earth

Example Program

Print analog and digital quantities detected by 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)

Function Description

earth_0.analogValue
  • Gets the analog value from the specified Earth device.
earth_0.digitalValue
  • Gets the digital value from the specified Earth device.
Page Tools
PDF
On This Page