
Works well after a little reading. I found that you do NOT need to set up a header file, just initialize the display with display.begin(SSD1306_SWITCHCAPVCC, 0x3C); Works on both Uno and Mega devices Uno PinoutSDA - A4SDL - A5GND - GNDVCC - 5vMega PinoutSDA - 20SDL - 21GND - GNDVCC - 5v Sample code for SSD1306 starts pushing the Uno's memory but Mega has no problem with it, to load the program. Being an OLED, it looks dead until initialization, which can be a little confusing when testing the screen for the first time. I thought I had a dud until I initialized it properly. There were no problems with 3.3V or 5V. Tested with a 30kΞ© thermistor. );#if (SSD1306_LCDHEIGHT != 64)#error("Invalid height, fix Adafruit_SSD1306.h!");#endif#define THERMISTORPIN A0 //which analog pin to connect#define THERMISTORNOMINAL 30000 //resistance at 25 degrees C #define TEMPERATURENOMINAL 25 // temp. for nominal resistance (almost always 25 C)#define NUMSAMPLES 50 // how many samples to take and average, more takes longer#define BCOEFFICIENT 4400 // thermistor beta coefficient (usually 3000-4000)#define SERIESRESISTOR 30000 //" other" resistance values [NUMSAMPLES]; void setup() { Serial.begin(9600); //connect AREF to 3.3V and use it as VCC, less noise! analog connection (EXTERNAL); // By default we generate a high voltage from the 3.3V line inside! (neat!) display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Initialization with I2C address 0x3D (for 128x64) // Initialization complete // Displaying the frame buffer on the display hardware. // Since the buffer is initialized internally by the Adafruit // splash, this is where the splash is shown. display.display(); delay(250); // clear buffer. display.clearDisplay(); } void loop() { uint8_t i; moving average; floating maximum temperature; maxtemp = 0; // take N samples in a row with a small delay delay(10); } // Average of all samples from Medium = 0; for (i=0; i< NUMSAMPLES; i++) { mean += Samples[i]; } mean /= NUMSAMPLES; display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); Serial.print("Analog"); Serial.println(Medium); display.print("Analog"); display.println(Medium); // convert value to resistance medium = 1023/average - 1; Mean = SERIES RESISTANCE / Mean; Serial.print("R"); Serial.println(Medium); display.print("R-Val"); display.println(Medium); display.setTextSize(2); Steinhart swimmers; float fconvert; float conversion value; rock hard = medium / THERMISTOMINAL; // (R/Ro)2 rock solid = log(rock solid); // ln(R/Ro) rock solid /= BCOEFFICIENT; // 1/B * ln(R/Ro) rock hard += 1.0 / (RATE TEMP + 273.15); // + (1/To) rock hard = 1.0 / rock hard; // invert rock hard -= 273.15; // convert to C Serial.print(rock hard); Serial.println("*C"); fconvert = rock hard * 1.8; fconvert = fconvert + 32; Serial.print("Temperature"); display.println("Temperature A0"); Serial.print(fconvert); Serial.println("*F"); display.print(rock hard); display.println("*C"); display.print(fconvert); display.println("*F"); display.display(); delay(250);}

Wall charger COMMO Compact charger 20W Single Type-C, White
47 Review

Realme 10 Smartphone 8/128 GB RU, Dual nano SIM, Black
87 Review

Hankook Tire Winter i*Pike RS2 W429 185/65 R15 92T
86 Review

Get Organized With MILAPEAK'S 280Pc Dual Wall Adhesive Heat Shrink Tubing Kit For Marine Cable DIY Projects
33 Review