i tried this example: https://github.com/micropython/micropyt ... ccellog.py
obviously some stuff has changed (time, accel), and i fixed that, so now it looks like that:
Code: Select all
import pyb
accel = pyb.Accel()
f = open('motion.dat', 'w') # open the file for writing
for i in range(60): # loop 60 times
time = pyb.millis() # get the current time
x, y, z = accel.filtered_xyz() # get the accelerometer data
# write time and x,y,z values to the file
f.write('{} {} {} {}\n'.format(time, x, y, z))
pyb.delay(1000) # wait 1000 ms = 1 second
f.close() # close the file
any ideas?