I am converting an Arduino code to python3. I am trying to read data from IMU 9250 sensor from the I2C interface of raspberry-pi. I am facing issue with the timing libraries of raspberry-pi and arduino. The
micros() api of Arduino gives time in microsecond as a 8 digit number. I used
datetime library available in python to get time in microseconds which gives a 6 digit number. I need it to be in 8 digit number for precise calculation purpose.
import datetime Now = datetime.datetime.now().microsecond # >>> 439014
I have tried getting time in milliseconds and converting it into microseconds using the
time library in python and moving ahead with the code, but the precision is lost with this approach.
How can i get time in microseconds as a 8 digit number python? If it is not possible to get the microseconds as a 8 digit number, then how should i approach with the problem?