pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

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.
On This Page