BME280 on RasPi Pico

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jpi82
 
Posts: 2
Joined: Fri Jan 29, 2021 9:59 pm

BME280 on RasPi Pico

Post by jpi82 »

My apologies if this is the incorrect forum for, I am new to microcontrollers and unsure if this is Adafruit, RasPi, or CircuitPython related.

I have a RasPi Pico with CircuitPython installed. I have copied the adafruit_bme280 library "adafruit_bme280.mpy" to \lib on my Pico. I am stepping into what I am trying to do via the REPL interface. The following throws "AttributeError: 'module' object has no attribute 'SCL'". Not sure where to go from here, from what I have read maybe I have the wrong board module installed? Thanks for the help!

Code: Select all

import board
import digitalio
import busio
import adafruit_bme280
i2c = busio.I2C(board.SCL, board.SDA)

User avatar
jpi82
 
Posts: 2
Joined: Fri Jan 29, 2021 9:59 pm

Re: BME280 on RasPi Pico

Post by jpi82 »

I headed https://discord.gg/adafruit and another user pointed out that my SDL and SDA references should be the GPIO pins. Ooos.

Code: Select all

i2c = busio.I2C(board.GP1, board.GP0)

User avatar
MrVakarian
 
Posts: 3
Joined: Tue Jun 01, 2021 4:28 pm

Re: BME280 on RasPi Pico

Post by MrVakarian »

Omg I know this is a few months old but I just want to say thanks for coming back with an updated answer. I am also new to all this stuff and I was having trouble finding a answer! So thanks!!

User avatar
mhm_nab
 
Posts: 8
Joined: Mon Oct 03, 2016 7:25 am

Re: BME280 on RasPi Pico

Post by mhm_nab »

I also faced the same issue and this post has saved me hours. Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”