Hello, I’m trying to use an ADS1115 on my ESP32 Lora V2, but I’m not getting it, could someone give me a tutorial with a sample code and the ports I should use, already test on 21 and 22 and also on 4 and 15.
ADS115 with ESP32 Lora V2
Maybe you can find the routines related to esp32 + ads1115 on GitHub.
yes, in Github there are several routines, but the biggest problem is when using in heltec lora v2, because when I call the display and the module everything works, but when I activate the lora automatically stops working the ads1115.
Can you show me your code?
This is a test code, it loads diplay and lora and then the ADS1115 and stops at it with the error message. If I disable LoRa in the parameter Heltec.begin(true, false, true, true, BAND); ADS1115 module works normally. Already tried several different ports to use as i2c.
#include “heltec.h” // Bibliteca LoRa e do Display
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads;
// Frequência da comunicação
#define BAND 915E6
// Definicao de portas
String rssi;
// Exibe a logo da heltec
void logo()
void setupDisplay(){
// Inicia o Display
Heltec.display->init();
Heltec.display->flipScreenVertically();
Heltec.display->setFont(ArialMT_Plain_10);
// Exibe a logo
delay(1500);
Heltec.display->clear();
Heltec.display->drawString(0, 0, “Test” +String(ID1));
Heltec.display->display();
delay(1000);
}
//Configurações iniciais do LoRa
void setupLoRa(){
Heltec.begin(true, true, true, true, BAND); // Parametros: DisplayEnable, HeltecLoRa, Serial, PABOOST, BAND
// Inicia o LoRa
LoRa.setSpreadingFactor(8);
LoRa.setSignalBandwidth(125E3);
LoRa.setCodingRate4(5);
LoRa.setPreambleLength(8);
LoRa.setSyncWord(0xF1);
// LoRa.disableCrc();
//Ativa o crc (dígito de verificação)
LoRa.enableCrc();
delay(1000);
//LoRa.onReceive(cbk);
LoRa.receive();
}
void setup(){
//Chama a configuração inicial do display
setupDisplay();
//Chama a configuração inicial do LoRa
setupLoRa();
Heltec.display->clear();
Heltec.display->drawString(0, 0, “Esperando Master…”);
Heltec.display->display();
// sensors.begin();
// pinMode(TdsSensorPin,INPUT);
// dht.begin();
if (!ads.begin()) {
Serial.println("Failed to initialize ADS.");
while (1);
}
}
uint32_t t_enviaMaster=millis();
void loop(){
Serial.println(“Test Loop”);
dalay(1000);
}
Does anyone have any solution?
I2C0 be used for OLED, maybe you need to use I2C1. When you select the pin to connect to ADS1115, you can first use I2C_Scnner to detection.