pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Accel

Example

from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
accel_0 = unit.get(unit.ACCEL, unit.PORTA)

while True:
  print((str('X ACC:') + str((accel_0.acceleration[0]))))
  print((str('Y ACC:') + str((accel_0.acceleration[1]))))
  print((str('Z ACC:') + str((accel_0.acceleration[2]))))
  wait_ms(2)

API

print((str('X ACC:') + str((accel_0.acceleration[0]))))
  • Get the X acceleration value
print((str('Y ACC:') + str((accel_0.acceleration[1]))))
  • Get the Y acceleration value
print((str('Z ACC:') + str((accel_0.acceleration[2]))))
  • Get the Z acceleration value
On This Page