Hi!
Sketch 1: Got a MAX6675 to work into an Arduino Uno. Get temp readings, and am able to see them on Serial.print output. Good!
Sketch 2: Got a Diymall 0.96" Inch I2c IIC Serial 128x64 Oled LCD LED White Display Module. Got it to work, only had to change the Adafruit library so the IIC address is 0x3C. got the IIC example to work. Better!
Now, it seems, I have a conflict, and need help to push my troubleshooting further. I copied the MAX6675 example code from the working sketch 1 to Sketch 2, and I get spurious readings from the MAX6675 module.
I tried my best to narrow down the symptoms to the following:
" Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit()); // <-- this gets me a good reading(1)!
delay(1000);
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit()); // <-- this gets me a good reading(2)!
delay(1000);
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit()); // <-- this gets me a good reading(3)!
delay(1000);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x64)
// init done
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit()); // <-- this gets me a spurious reading(4)!
delay(1000);
"
Sample output:
MAX6675 test
F = 75.65 --> good reading (1)
F = 75.65 --> good reading (2)
F = 75.65 --> good reading (3)
F = nan --> spurious reading (4)
F = nan --> spurious reading (5)
F = 3710.75 --> spurious reading (6)
F = 3710.75 --> spurious reading (7)
F = nan --> spurious reading (8)
F = 3710.75 --> you get the idea...
F = 3710.75
F = nan
F = 3710.75
F = 3710.75
F = 3710.75
F = 3710.75
F = 3710.75
F = 3710.75
F = 3710.75
F = nan
It seems that as the OLED-related function
" display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x64)"
gets called, it creates some corruption from which my code never recovers.
- Am new to Arduino, and most appreciate your kind assistance.
- am more looking for "how to fish" than "fish".
- Specifically, as I endeavor to follow the code through the libraries of either the SSD1306 display, as it seems to trigger the conflict at initialization, or the libraries of the MAX6675, to try and monitor the output of the module as it is read into the Arduino, I get lost.
My "theory", is that the data that comes back from the MAX6675 is not spurious, but that somehow it gets stored in a variable that gets corrupted.
I do get this warning at compilation time: "Global variables use 1,598 bytes (78%) of dynamic memory, leaving 450 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur."
I would like some hints on:
- How to follow the thread through multiple libraries: are there debugging tools I should learn, etc???
- How to identify where the "raw" data comes into Arduino Uno from the MAX6675 module, and monitor it (send it to the serial port?) right at that point.
10,000 good karma point offered to all kind souls who help me.
Humbled,
Boucanier.