Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Max6675 Thermocouple Amplifier with OLED Demo
- learnelectronics
- 17 JUL 2018
- www.youtube.com/c/learnelectronics
- email: [email protected]
- MAX6675 Library Created by Ryan McLaughlin <[email protected]>
- Download the library here: https://github.com/mcleng/MAX6675-Library
- */
- #include <MAX6675.h> //Library for 6675 IC
- #include <Wire.h> //I2C Library
- #include <Adafruit_SSD1306.h> //Library for OLED with SSD1306 IC
- #define OLED_RESET 4 //OLED reset on digital 4
- float temperature = 0.0; // Temperature output variable
- /
- MAX6675 temp(10,12,13,2); // Initialize the MAX6675 Library for our chip
- Adafruit_SSD1306 display(OLED_RESET); // Initialize the SSD1306 Library for our chip
- void setup() {
- Serial.begin(9600); //Serial comms @ 9600
- display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Start up the oled at hex addy 0x3c
- display.display(); //show logo
- delay(2000); //enjoy logo
- display.clearDisplay(); //goodbye logo
- }
- void loop() {
- temperature = temp.read_temp(); // Read the temp from the MAX6675
- display.clearDisplay(); //clear display
- display.setTextSize(2); //text size 2
- display.setTextColor(WHITE); //text color white
- display.setCursor(15,25); //kinda middle-ish
- display.print(temperature); //send temp reading to display buffer
- display.print(" F"); //send units to display buffer
- display.display(); //show me the buffer
- delay(2000); //whew! that was hard. lets take a breath
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement