SO CHANGE YOUR PROGRAM LIKE THIS:
Close the serial monitor, upload the program, and reopen
the serial monitor. You will see that the current
temperature is now being output at regular intervals.
#include <KosmoBits_Pins.h>
#include <KosmoBits_Thermistor.h>
const int sensorPin = KOSMOBITS_SENSOR_PIN;
void setup() {
pinMode(sensorPin, INPUT);
Serial.begin(115200);
// Enable output via
// serial monitor.
}
void loop() {
int measurement = analogRead(sensorPin);
float celsius = thermistor_measurement_in_
celsius(measurement);
// Convert
// measurement into degrees Celsius.
Serial.print(celsius);
// Celsius value
// is output.
Serial.println(" degrees Celsius");
// Output
// of"Degrees Celsius" and line break.
delay(1000);
}
</>
34
PROJECT 8
CodeGamer manual inside english.indd 34
7/19/16 12:32 PM