pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit AMeter

Example

Measure current

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)
AMeter_0 = unit.get(unit.AMETER, unit.PORTA)

while True:
  print((str('Current: ') + str(((str((AMeter_0.current())) + str(' mA'))))))
  wait(0.3)
  wait_ms(2)

API

print((str('Curent:') + str((AMeter_0.current()))))
  • Get measured current
print((str('raw:') + str((AMeter_0.raw()))))
  • Get raw data of measured current
AMeter_0.setGain(AMeter_0.PGA_256)
  • Set maximum input current
AMeter_0.setMode(AMeter_0.MODE_CONTINUOUS)
  • Set operating mode
  • continuous
  • singleshot
AMeter_0.setRate(AMeter_0.RATE_8)
  • Set samples per second
On This Page
Example
API
Q&A
Submit a question
Select question category*
Arduino
MicroPython
UIFlow1
UIFlow2
EzData
M5Burner
Software
Hardware
Other
Product name
Product version
Question description*
(Supports pasting screenshots.)
Attachments
Add Files
Email*
Submit
OK

M5Stack Support

Hi, this is M5Stack Support. How can I help you today?