IP Configuration
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
/***************************************************
|
||||
This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
|
||||
|
||||
Designed specifically to work with the Adafruit Thermocouple Sensor
|
||||
----> https://www.adafruit.com/products/269
|
||||
|
||||
These displays use SPI to communicate, 3 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
#include "Adafruit_MAX31855.h"
|
||||
#include <LiquidCrystal.h>
|
||||
|
||||
// Example creating a thermocouple instance with software SPI on any three
|
||||
// digital IO pins.
|
||||
#define MAXDO 3
|
||||
#define MAXCS 4
|
||||
#define MAXCLK 5
|
||||
|
||||
// Initialize the Thermocouple
|
||||
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
|
||||
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
|
||||
#define Serial SerialUSB
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
#ifndef ESP8266
|
||||
while (!Serial); // will pause Zero, Leonardo, etc until serial console opens
|
||||
#endif
|
||||
Serial.begin(9600);
|
||||
// set up the LCD's number of columns and rows:
|
||||
lcd.begin(16, 2);
|
||||
|
||||
lcd.clear();
|
||||
lcd.print("MAX31855 test");
|
||||
// wait for MAX chip to stabilize
|
||||
delay(500);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// basic readout test, just print the current temp
|
||||
lcd.clear();
|
||||
lcd.setCursor(0, 0);
|
||||
lcd.print("Int. Temp = ");
|
||||
lcd.println(thermocouple.readInternal());
|
||||
Serial.print("Int. Temp = ");
|
||||
Serial.println(thermocouple.readInternal());
|
||||
|
||||
double c = thermocouple.readCelsius();
|
||||
lcd.setCursor(0, 1);
|
||||
if (isnan(c))
|
||||
{
|
||||
lcd.print("T/C Problem");
|
||||
}
|
||||
else
|
||||
{
|
||||
lcd.print("C = ");
|
||||
lcd.print(c);
|
||||
lcd.print(" ");
|
||||
Serial.print("Thermocouple Temp = *");
|
||||
Serial.println(c);
|
||||
}
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/***************************************************
|
||||
This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
|
||||
|
||||
Designed specifically to work with the Adafruit Thermocouple Sensor
|
||||
----> https://www.adafruit.com/products/269
|
||||
|
||||
These displays use SPI to communicate, 3 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <SPI.h>
|
||||
#include "Adafruit_MAX31855.h"
|
||||
|
||||
// Default connection is using software SPI, but comment and uncomment one of
|
||||
// the two examples below to switch between software SPI and hardware SPI:
|
||||
|
||||
// Example creating a thermocouple instance with software SPI on any three
|
||||
// digital IO pins.
|
||||
#define MAXDO 3
|
||||
#define MAXCS 4
|
||||
#define MAXCLK 5
|
||||
|
||||
// initialize the Thermocouple
|
||||
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
|
||||
|
||||
// Example creating a thermocouple instance with hardware SPI
|
||||
// on a given CS pin.
|
||||
//#define MAXCS 10
|
||||
//Adafruit_MAX31855 thermocouple(MAXCS);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc
|
||||
|
||||
Serial.println("MAX31855 test");
|
||||
// wait for MAX chip to stabilize
|
||||
delay(500);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// basic readout test, just print the current temp
|
||||
Serial.print("Internal Temp = ");
|
||||
Serial.println(thermocouple.readInternal());
|
||||
|
||||
double c = thermocouple.readCelsius();
|
||||
if (isnan(c)) {
|
||||
Serial.println("Something wrong with thermocouple!");
|
||||
} else {
|
||||
Serial.print("C = ");
|
||||
Serial.println(c);
|
||||
}
|
||||
//Serial.print("F = ");
|
||||
//Serial.println(thermocouple.readFarenheit());
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user