English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Hat ADC

Example

Print the acquired voltage value and raw data to the serial monitor.

from m5stack import *
from m5ui import *
from uiflow import *
import hat
import hat

setScreenColor(0x111111)

hat_adc_1 = hat.get(hat.ADC)

print(hat_adc_1.voltage)
print(hat_adc_1.rawData())

API

hat_adc_0.rawData()
  • Read the raw data from the ADC.
hat_adc_0.voltage
  • Read the voltage value from the ADC.
Page Tools
PDF
On This Page