IP Configuration
This commit is contained in:
43
lib/Arduino_MKRTHERM/examples/ReadSensor/ReadSensor.ino
Normal file
43
lib/Arduino_MKRTHERM/examples/ReadSensor/ReadSensor.ino
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
MKR THERM Shield - Read Sensors
|
||||
|
||||
This example reads the temperatures measured by the thermocouple
|
||||
connected to the MKR THERM shield and prints them to the Serial Monitor
|
||||
once a second.
|
||||
|
||||
The circuit:
|
||||
- Arduino MKR board
|
||||
- Arduino MKR THERM Shield attached
|
||||
- A K Type thermocouple temperature sensor connected to the shield
|
||||
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
#include <Arduino_MKRTHERM.h>
|
||||
|
||||
void setup() {
|
||||
|
||||
Serial.begin(9600);
|
||||
|
||||
while (!Serial);
|
||||
|
||||
if (!THERM.begin()) {
|
||||
Serial.println("Failed to initialize MKR THERM shield!");
|
||||
while (1);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Serial.print("Reference temperature ");
|
||||
Serial.print(THERM.readReferenceTemperature());
|
||||
Serial.println(" °C");
|
||||
|
||||
Serial.print("Temperature ");
|
||||
Serial.print(THERM.readTemperature());
|
||||
Serial.println(" °C");
|
||||
|
||||
Serial.println();
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user