Skip to content

Commit 4af10ca

Browse files
committed
fix pub time
1 parent ffb1f1c commit 4af10ca

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

STM32duino_sample/RT-9DOF-IMU-V3-Quat/RT-9DOF-IMU-V3-Quat.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ void timerInterrupt(void) {
7676
double gy = ((double)data.Raw_Gyro.Data.Y) / 16.3835 * PI / 180.0;
7777
double gz = ((double)data.Raw_Gyro.Data.Z) / 16.3835 * PI / 180.0;
7878

79-
double time = (double)micros() / 1000000.0;
79+
uint32_t time_sec = micros()/1000000;
80+
uint32_t time_subsecs = micros() - time_sec*1000000;
8081

81-
SERIAL_PORT.print(time, 4);
82+
SERIAL_PORT.print(time_sec);
83+
SERIAL_PORT.print(F("."));
84+
SERIAL_PORT.print(time_subsecs);
8285
SERIAL_PORT.print(F(","));
8386
SERIAL_PORT.print(q1, 4);
8487
SERIAL_PORT.print(F(","));

0 commit comments

Comments
 (0)