#include <Wire.h>
#include "rgb_lcd.h"
rgb_lcd lcd;
const int colorR = 255;
const int colorG = 0;
const int colorB = 0;
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.setRGB(colorR, colorG, colorB);
// Print a message to the LCD.
lcd.print("hello, world!");
delay(1000);
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
delay(100);
}
#include <math.h>
const int B = 4275; // B value of the thermistor
const int R0 = 100000; // R0 = 100k
const int pinTempSensor = A5; // Grove - Temperature Sensor connect to A5
void setup()
{
Serial.begin(9600);
}
void loop()
{
int a = analogRead(pinTempSensor);
float R = 1023.0/a-1.0;
R = R0*R;
// convert to temperature via datasheet
float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15;
Serial.print("temperature = ");
Serial.println(temperature);
delay(100);
}
#include <math.h>
const int B = 4275; // B value of the thermistor
const int R0 = 100000; // R0 = 100k
const int pinTempSensor = A1; // Grove - Temperature Sensor connect to A1
void setup()
{
pinMode(pinTempSensor, INPUT);
}
void loop()
{
int a = analogRead(pinTempSensor);
float R = 4095.0/a-1.0;
R = R0*R;
// convert to temperature via datasheet
float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15;
Serial.print("temperature = ");
Serial.println(temperature);
delay(100);
}