Skip to content

Instantly share code, notes, and snippets.

@EDISON-SCIENCE-CORNER
Created March 27, 2022 10:51
Show Gist options
  • Save EDISON-SCIENCE-CORNER/bc62f9bad26c64349a934ca3e4007cbe to your computer and use it in GitHub Desktop.
Save EDISON-SCIENCE-CORNER/bc62f9bad26c64349a934ca3e4007cbe to your computer and use it in GitHub Desktop.
#include "max6675.h"
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
void setup() {
u8g2.begin();
u8g2.setFont(u8g2_font_lucasarts_scumm_subtitle_o_tr);
u8g2.setCursor(30, 16);
u8g2.print("THERMO");
u8g2.setCursor(37, 32);
u8g2.print("METER");
u8g2.sendBuffer();
delay(6000);
}
void loop() {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_maniac_tr);
u8g2.setCursor(1, 30);
u8g2.print(" ");
u8g2.println(thermocouple.readCelsius());
u8g2.setFont(u8g2_font_timB24_tn);
u8g2.setCursor(102, 11);
u8g2.print(".");
u8g2.setFont(u8g2_font_bubble_tr);
u8g2.setCursor(99, 30);
u8g2.print(" C ");
u8g2.sendBuffer();
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment