Skip to content

Commit

Permalink
set scl freq to 100k; firebeetle v2 did not work with 400k
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-fryza committed Nov 20, 2024
1 parent f124df4 commit 47a7cd4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion solutions/06-serial/01-i2c_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from machine import Pin

# Init I2C using pins GP22 & GP21 (default I2C0 pins)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)

print("Scanning I2C... ", end="")
addrs = i2c.scan()
Expand Down
2 changes: 1 addition & 1 deletion solutions/06-serial/02-i2c_rtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
led = Led(2)
led.off()

i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)
addrs = i2c.scan()
if RTC_ADDR not in addrs:
raise Exception(f"`{hex(RTC_ADDR)}` is not detected")
Expand Down
2 changes: 1 addition & 1 deletion solutions/06-serial/02-i2c_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
SENSOR_ADDR = 0x5c # DHT12

# Init I2C using pins GP22 & GP21 (default I2C0 pins)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)

# Check the sensor
addrs = i2c.scan()
Expand Down
2 changes: 1 addition & 1 deletion solutions/06-serial/02-i2c_sensor_bme280.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import bme280

# Init BME280 sensor
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)
bme = bme280.BME280(i2c=i2c)

print(f"I2C configuration : {str(i2c)}")
Expand Down
2 changes: 1 addition & 1 deletion solutions/06-serial/03-i2c_oled.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sh1106 import SH1106_I2C

# Init I2C using pins GP22 & GP21 (default I2C0 pins)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)
print(f"I2C configuration : {str(i2c)}")

# Init OLED display
Expand Down
2 changes: 1 addition & 1 deletion solutions/06-serial/04-i2c_sensor_oled.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from sh1106 import SH1106_I2C

# Init DHT12 sensor
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=400_000)
i2c = I2C(0, scl=Pin(22), sda=Pin(21), freq=100_000)
sensor = dht12.DHT12(i2c)

# Init OLED display
Expand Down

0 comments on commit 47a7cd4

Please sign in to comment.