Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heltec lora v3 and BME280 problem #263

Open
SirBartolomeoDHN opened this issue Dec 3, 2024 · 0 comments
Open

Heltec lora v3 and BME280 problem #263

SirBartolomeoDHN opened this issue Dec 3, 2024 · 0 comments

Comments

@SirBartolomeoDHN
Copy link

Hi, I'm new to this world and don't know much. I need to connect a BME280 (the one with 4 pins: VCC, GND, SDA, SCL) to a Heltec LoRa V3, which comes with an OLED display.

I’ve already tried the display, and it works fine, but once I started trying to connect the BME280, I ran into multiple problems. First, I have no idea where to connect the sensor. ChatGPT and other forums say to use GPIO 21 and 22, but my board doesn’t have GPIO 22.

Others say that both the OLED and the sensor use I2C, so I need to split them up. However, I’ve tried many codes from different tutorials and forums, and none of them worked. Does anyone have any ideas on how to fix my issues? I need to know where to connect the sensor and a suitable code to read it correctly.

I’ll upload some photos of the board—it's a V3.1.
20241203_194102

image

here is also the code i tried for the display

#include <Wire.h>
#include "HT_SSD1306Wire.h"

// Inizializza il display OLED
SSD1306Wire oledDisplay(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED);

// Variabile per il contatore
int counter = 0;

void setup() {
// Inizializza la comunicazione seriale
Serial.begin(115200);

// Inizializza il display
oledDisplay.init();
oledDisplay.clear();
oledDisplay.display();

// Mostra un messaggio iniziale
oledDisplay.drawString(0, 0, "Inizializzazione...");
oledDisplay.display();
delay(2000); // Pausa di 2 secondi
}

void loop() {
// Incrementa il contatore
counter++;

// Stampa il valore del contatore sul display
oledDisplay.clear();
oledDisplay.drawString(0, 0, "Numero:");
oledDisplay.drawString(0, 20, String(counter));
oledDisplay.display();

// Mostra il valore del contatore nella console seriale
Serial.println("Contatore: " + String(counter));

// Pausa di 1 secondo
delay(1000);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant