Hi everyone,
To have a more correct reading of the values of a thermistor I am trying to use the ADC converter ADS1115.
I tried to connect it as shown in the picture ... but when I try to read the values it goes wrong and then starts printing wrong characters.
this is the sketch used to read the voltage
#include <Wire.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1115 ads(0x48);
float Voltage = 0.0;
void setup(void)
{
Serial.begin(9600);
ads.begin();
}
void loop(void)
{
int16_t adc0;
adc0 = ads.readADC_SingleEnded(0);
Voltage = (adc0 * 0.1875)/1000;
Serial.print("AIN0: ");
Serial.print(adc0);
Serial.print("\tVoltage: ");
Serial.println(Voltage, 7);
Serial.println();
delay(1000);
}
And this is the error i get
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x800d0f3c PS : 0x00060530 A0 : 0x400d0ee8 A1 : 0x3ffb1f00
A2 : 0x3ffc0260 A3 : 0x00000048 A4 : 0x00000002 A5 : 0x00000001
A6 : 0x00060320 A7 : 0x00000000 A8 : 0x00000002 A9 : 0x00000080
A10 : 0x00000002 A11 : 0x00000048 A12 : 0x3ffc0260 A13 : 0x00000002
A14 : 0x00000001 A15 : 0x3ffb1f0c SAR : 0x0000001d EXCCAUSE: 0x00000014
EXCVADDR: 0x800d0f3c LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
Backtrace: 0x400d0f3c:0x3ffb1f00 0x400d0ee5:0x3ffb1f30 0x400d100d:0x3ffb1f50 0x400d1083:0x3ffb1f70 0x400d0c64:0x3ffb1f90 0x400d24f9:0x3ffb1fb0 0x400889d9:0x3ffb1fd0
Rebooting...
a8⸮⸮⸮*!ġ$+U!⸮ ⸮⸮a@HP; 1 ⸮j⸮*!ġ$⸮a@⸮⸮⸮w⸮ 1P<⸮>|⸮ 1⸮⸮⸮@⸮ 1⸮⸮⸮⸮䂍P⸮⸮`⸮I!T ⸮⸮*!ġ$+ 1P<⸮>|⸮a,⸮⸮⸮⸮+!⸮P;a,⸮$⸮w⸮
about this error exception decoder says
PC: 0x400d103c: Adafruit_ADS1015::readADC_SingleEnded(unsigned char) at /Users/matteoandreoli/Documents/Arduino/libraries/Adafruit_ADS1X15/Adafruit_ADS1015.cpp line 182
EXCVADDR: 0x00000000
Decoding stack results
0x400d103c: Adafruit_ADS1015::readADC_SingleEnded(unsigned char) at /Users/matteoandreoli/Documents/Arduino/libraries/Adafruit_ADS1X15/Adafruit_ADS1015.cpp line 182
0x400d235d: String::changeBuffer(unsigned int) at /Users/matteoandreoli/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/WString.cpp line 168
0x400889d9: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
n the attached photo you can see the scheme I followed for the connections, my version is 16bit not 12 as in the photo and i have connected to A0.. what did i wrong? is it wired correctly?
thank you very much