Skip to content

Commit 52f3962

Browse files
committed
2 parents ccabfe7 + 93e3dae commit 52f3962

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,6 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
.idea/
161+
162+
# Finder preferences on Mac
163+
.DS_Store

examples/03-bno086/main.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from utime import ticks_ms, sleep_ms
1010
import math
1111
from bno08x import *
12+
import gc
13+
gc.collect()
14+
# print(gc.mem_free()) # Check available memory
1215

1316
I2C1_SDA = Pin(21)
1417
I2C1_SCL = Pin(22)
@@ -19,8 +22,8 @@
1922
print("BNO08x I2C connection : Done")
2023

2124
bno.enable_feature(BNO_REPORT_ACCELEROMETER, 20)
22-
bno.enable_feature(BNO_REPORT_MAGNETOMETER,20 )
23-
bno.enable_feature(BNO_REPORT_GYROSCOPE,20 )
25+
bno.enable_feature(BNO_REPORT_MAGNETOMETER, 20)
26+
bno.enable_feature(BNO_REPORT_GYROSCOPE, 20)
2427
bno.enable_feature(BNO_REPORT_GAME_ROTATION_VECTOR, 10)
2528
bno.set_quaternion_euler_vector(BNO_REPORT_GAME_ROTATION_VECTOR)
2629

@@ -37,14 +40,14 @@
3740
sleep_ms(50)
3841
cpt += 1
3942
# print("cpt", cpt)
40-
# accel_x, accel_y, accel_z = bno.acc
41-
# print("Acceleration\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\tm/s²".format(accel_x, accel_y, accel_z))
42-
# gyro_x, gyro_y, gyro_z = bno.gyro
43-
# print("Gyroscope\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\trads/s".format(gyro_x, gyro_y, gyro_z))
44-
# mag_x, mag_y, mag_z = bno.mag
45-
# print("Magnetometer\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\tuT".format(mag_x, mag_y, mag_z))
46-
# quat_i, quat_j, quat_k, quat_real = bno.quaternion
47-
# print("Rot Vect Quat\tI: {:+.3f}\tJ: {:+.3f}\tK: {:+.3f}\tReal: {:+.3f}".format(quat_i, quat_j, quat_k, quat_real))
43+
# accel_x, accel_y, accel_z = bno.acc
44+
# print("Acceleration\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\tm/s²".format(accel_x, accel_y, accel_z))
45+
# gyro_x, gyro_y, gyro_z = bno.gyro
46+
# print("Gyroscope\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\trads/s".format(gyro_x, gyro_y, gyro_z))
47+
# mag_x, mag_y, mag_z = bno.mag
48+
# print("Magnetometer\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}\tuT".format(mag_x, mag_y, mag_z))
49+
# quat_i, quat_j, quat_k, quat_real = bno.quaternion
50+
# print("Rot Vect Quat\tI: {:+.3f}\tJ: {:+.3f}\tK: {:+.3f}\tReal: {:+.3f}".format(quat_i, quat_j, quat_k, quat_real))
4851
R, T, P = bno.euler
4952
print("Euler Angle\tX: {:+.3f}\tY: {:+.3f}\tZ: {:+.3f}".format(R, T, P))
5053
# print("===================================")
@@ -61,3 +64,4 @@
6164
print("Program stopped. Exiting...")
6265

6366
# Optional cleanup code
67+
gc.collect() # Garbage collector (GC), Free unused memory

examples/11-gps/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)