@teastain thx for the hint! It's just as you said about acceleration.
Btw: UIFlow works. I just installed the incorrect firmware (UIFlow2.0 instead of UIFlow2.0 AtomS3R).
Thanks again everyone!
@teastain thx for the hint! It's just as you said about acceleration.
Btw: UIFlow works. I just installed the incorrect firmware (UIFlow2.0 instead of UIFlow2.0 AtomS3R).
Thanks again everyone!
Thanks for answering, guys.
I tried the Arduino example as suggested by @kuriko and indeed I get non-zero readings! So maybe @felmue is right to assume that UIFlow2 doesn't fully support M5AtomS3R yet.
The IMU readings don't make a lot of sense to me yet, I will next try to calibrate with this example code:
https://github.com/m5stack/M5Unified/blob/master/examples/Basic/Imu/Imu.ino
Hi everyone,
I bought an ATOMS3R, and burned the UIFlow2.0 ATOMS3R firmware on it. In UIFlow 2.0 I tried to print the accelerometer and gyroscope readings with below code.
However, the readings are all zero regardless of how I move or shake the ATOM. Did I miss an initialization or calibration step?
import os, sys, io
import M5
from M5 import *
import time
accel = None
gyro = None
def setup():
global accel, gyro
M5.begin()
def loop():
global accel, gyro
M5.update()
acc_x, acc_y, acc_z = Imu.getAccel()
gyro_x, gyro_y, gyro_z = Imu.getGyro()
print(f'accel: {acc_x}x, {acc_y}y, {acc_z}z')
print(f'gyro: {gyro_x}x, {gyro_y}y, {gyro_z}z')
time.sleep(1)
if __name__ == '__main__':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")