Skip to content

Commit d09180f

Browse files
add package.json for mip packaging, clean up prints for MicroPython
1 parent b3202b0 commit d09180f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

examples/ex1_qwiic_ICM20948.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
# Example 1
4040
#
4141

42-
from __future__ import print_function
4342
import qwiic_icm20948
4443
import time
4544
import sys
@@ -55,20 +54,20 @@ def runExample():
5554
return
5655

5756
IMU.begin()
58-
57+
5958
while True:
6059
if IMU.dataReady():
6160
IMU.getAgmt() # read all axis and temp from sensor, note this also updates all instance variables
6261
print(\
63-
'{: 06d}'.format(IMU.axRaw)\
64-
, '\t', '{: 06d}'.format(IMU.ayRaw)\
65-
, '\t', '{: 06d}'.format(IMU.azRaw)\
66-
, '\t', '{: 06d}'.format(IMU.gxRaw)\
67-
, '\t', '{: 06d}'.format(IMU.gyRaw)\
68-
, '\t', '{: 06d}'.format(IMU.gzRaw)\
69-
, '\t', '{: 06d}'.format(IMU.mxRaw)\
70-
, '\t', '{: 06d}'.format(IMU.myRaw)\
71-
, '\t', '{: 06d}'.format(IMU.mzRaw)\
62+
'ax: {: 06d}'.format(IMU.axRaw)\
63+
, '\t', 'ay: {: 06d}'.format(IMU.ayRaw)\
64+
, '\t', 'az: {: 06d}'.format(IMU.azRaw)\
65+
, '\t', 'gx: {: 06d}'.format(IMU.gxRaw)\
66+
, '\t', 'gy: {: 06d}'.format(IMU.gyRaw)\
67+
, '\t', 'gz: {: 06d}'.format(IMU.gzRaw)\
68+
, '\t', 'mx: {: 06d}'.format(IMU.mxRaw)\
69+
, '\t', 'my: {: 06d}'.format(IMU.myRaw)\
70+
, '\t', 'mz: {: 06d}'.format(IMU.mzRaw)\
7271
)
7372
time.sleep(0.03)
7473
else:

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"urls": [
3+
["qwiic__icm209480.py", "github:sparkfun/Qwiic_9DoF_IMU_ICM20948_Py/qwiic__icm20948.py"]
4+
],
5+
"deps": [
6+
["github:sparkfun/Qwiic_I2C_Py", "master"]
7+
],
8+
"version": "0.0.1"
9+
}

qwiic_icm20948.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
acc_d5bw7_n8bw3 = 0x06
105105
acc_d473bw_n499bw = 0x07
106106

107-
# Gryo low pass filter configuration options
107+
# Gyro low pass filter configuration options
108108
# Format is dAbwB_nXbwZ - A is integer part of 3db BW, B is fraction. X is integer part of nyquist bandwidth, Y is fraction
109109
gyr_d196bw6_n229bw8 = 0x00
110110
gyr_d151bw8_n187bw6 = 0x01
@@ -1045,7 +1045,7 @@ def begin(self):
10451045
# set sample mode to continuous for both accel and gyro
10461046
self.setSampleMode((ICM_20948_Internal_Acc | ICM_20948_Internal_Gyr), ICM_20948_Sample_Mode_Continuous)
10471047

1048-
# set full scale range for both accel and gryo (separate functions)
1048+
# set full scale range for both accel and gyro (separate functions)
10491049
self.setFullScaleRangeAccel(gpm2)
10501050
self.setFullScaleRangeGyro(dps250)
10511051

0 commit comments

Comments
 (0)