You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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);
}
The text was updated successfully, but these errors were encountered:
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.
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);
}
The text was updated successfully, but these errors were encountered: