Thermocouple test
This commit is contained in:
parent
2bbee6ebb2
commit
d33f2c1d6a
|
@ -2,6 +2,8 @@
|
|||
#include <Arduino.h>
|
||||
#include <U8g2lib.h>
|
||||
#include <Encoder.h>
|
||||
//#include "Adafruit_MAX31855.h"
|
||||
#include "max6675.h"
|
||||
|
||||
#ifdef U8X8_HAVE_HW_SPI
|
||||
#include <SPI.h>
|
||||
|
@ -10,12 +12,21 @@
|
|||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8);
|
||||
//U8G2_ST7920_128X64_1_HW_SPI(rotation, cs [, reset]) [page buffer, size = 128 bytes]
|
||||
//U8G2_ST7920_128X64_2_HW_SPI(rotation, cs [, reset]) [page buffer, size = 256 bytes]
|
||||
//U8G2_ST7920_128X64_F_HW_SPI(rotation, cs [, reset]) [full framebuffer, size = 1024 bytes]
|
||||
U8G2_ST7920_128X64_2_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8);
|
||||
|
||||
Encoder rotEncoder(2, 3);
|
||||
|
||||
const int buzzer = 5;
|
||||
|
||||
#define MAXDO 7
|
||||
#define MAXCS 8
|
||||
#define MAXCLK 9
|
||||
|
||||
MAX6675 thermocouple(MAXCLK, MAXCS, MAXDO);
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(9600);
|
||||
Serial.println("Hardware Test:");
|
||||
|
@ -25,12 +36,12 @@ void setup(void) {
|
|||
u8g2.begin();
|
||||
|
||||
Serial.println("Buzzer Test");
|
||||
tone(buzzer, 1000, 5000);
|
||||
Serial.println("Buzzer Test");
|
||||
delay(1000);
|
||||
Serial.println("Buzzer Test 2");
|
||||
delay(1000);
|
||||
Serial.println("Buzzer Test 3");
|
||||
tone(buzzer, 8000, 500);
|
||||
|
||||
Serial.print("C = ");
|
||||
Serial.println(thermocouple.readCelsius());
|
||||
Serial.print("F = ");
|
||||
Serial.println(thermocouple.readFahrenheit());
|
||||
}
|
||||
|
||||
long EncPos = 0;
|
||||
|
|
Loading…
Reference in New Issue