-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9763a67
commit 23f61b7
Showing
15 changed files
with
310 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
version: 2 | ||
|
||
build: | ||
os: ubuntu-20.04 | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
{ | ||
"urls": [ | ||
["micropython_icm20948/examples/icm20948_simpletest.py", "github:jposada202020/MicroPython_ICM20948/examples/icm20948_simpletest.py"] | ||
[ | ||
"micropython_icm20948/examples/icm20948_acc_dlpf_cutoff.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_acc_dlpf_cutoff.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_temperature.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_temperature.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_simpletest.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_simpletest.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_gyro_full_scale.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_gyro_full_scale.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_accelerometer_range.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_accelerometer_range.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_clock_select.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_clock_select.py" | ||
], | ||
[ | ||
"micropython_icm20948/examples/icm20948_gyro_dlpf_cutoff.py", | ||
"github:jposada202020/MicroPython_ICM20948/examples/icm20948_gyro_dlpf_cutoff.py" | ||
] | ||
], | ||
"version": "0.1" | ||
"version": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(1, sda=Pin(2), scl=Pin(3)) # Correct I2C pins for RP2040 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
icm.acc_dlpf_cutoff = icm20948.FREQ_246_0 | ||
|
||
while True: | ||
for acc_dlpf_cutoff in icm20948.acc_filter_values: | ||
print("Current Acc dlpf cutoff setting: ", icm.acc_dlpf_cutoff) | ||
for _ in range(10): | ||
accx, accy, accz = icm.acceleration | ||
print("x:{:.2f}m/s2, y:{:.2f}m/s2, z:{:.2f}m/s2".format(accx, accy, accz)) | ||
print() | ||
time.sleep(0.5) | ||
icm.acc_dlpf_cutoff = acc_dlpf_cutoff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(1, sda=Pin(2), scl=Pin(3)) # Correct I2C pins for RP2040 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
icm.accelerometer_range = icm20948.RANGE_2G | ||
|
||
while True: | ||
for accelerometer_range in icm20948.acc_range_values: | ||
print("Current Accelerometer range setting: ", icm.accelerometer_range) | ||
for _ in range(10): | ||
accx, accy, accz = icm.acceleration | ||
print("x:{:.2f}m/s2, y:{:.2f}m/s2, z:{:.2f}m/s2".format(accx, accy, accz)) | ||
print() | ||
time.sleep(0.5) | ||
icm.accelerometer_range = accelerometer_range |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(1, sda=Pin(2), scl=Pin(3)) # Correct I2C pins for RP2040 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
icm.clock_select = icm20948.CLK_SELECT_INTERNAL | ||
|
||
while True: | ||
for clock_select in icm20948.clk_values: | ||
print("Current Clock select setting: ", icm.clock_select) | ||
for _ in range(10): | ||
accx, accy, accz = icm.acceleration | ||
print("x:{:.2f}m/s2, y:{:.2f}m/s2, z:{:.2f}m/s2".format(accx, accy, accz)) | ||
print() | ||
time.sleep(0.5) | ||
icm.clock_select = clock_select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(1, sda=Pin(2), scl=Pin(3)) # Correct I2C pins for RP2040 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
icm.gyro_dlpf_cutoff = icm20948.G_FREQ_11_6 | ||
|
||
while True: | ||
for gyro_dlpf_cutoff in icm20948.gyro_filter_values: | ||
print("Current Gyro dlpf cutoff setting: ", icm.gyro_dlpf_cutoff) | ||
for _ in range(10): | ||
gyrox, gyroy, gyroz = icm.gyro | ||
print("x:{:.2f}°/s, y:{:.2f}°/s, z:{:.2f}°/s".format(gyrox, gyroy, gyroz)) | ||
print() | ||
time.sleep(0.5) | ||
icm.gyro_dlpf_cutoff = gyro_dlpf_cutoff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(1, sda=Pin(2), scl=Pin(3)) # Correct I2C pins for RP2040 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
icm.gyro_full_scale = icm20948.FS_250_DPS | ||
|
||
while True: | ||
for gyro_full_scale in icm20948.gyro_full_scale_values: | ||
print("Current Gyro full scale setting: ", icm.gyro_full_scale) | ||
for _ in range(10): | ||
gyrox, gyroy, gyroz = icm.gyro | ||
print("x:{:.2f}°/s, y:{:.2f}°/s, z:{:.2f}°/s".format(gyrox, gyroy, gyroz)) | ||
print() | ||
time.sleep(0.5) | ||
icm.gyro_full_scale = gyro_full_scale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
|
||
import time | ||
from machine import Pin, I2C | ||
from micropython_icm20948 import icm20948 | ||
|
||
i2c = I2C(sda=Pin(8), scl=Pin(9)) # Correct I2C pins for UM FeatherS2 | ||
icm = icm20948.ICM20948(i2c) | ||
|
||
|
||
while True: | ||
print(f"Temperature: {icm.temperature}°C") | ||
print() | ||
time.sleep(1) |
Oops, something went wrong.