Here is the code :
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float currentTemp = tempsensor();
int ledPin = 13;
int inPin = 7;
int val = 0;
digitalWrite(LED, HIGH);
digitalWrite(LED, LOW);
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(inPin, INPUT);
lcd.begin(16, 2);
}
void loop() {
val = digitalRead(inPin);
if (val == HIGH) {
float currentTemp = tempsensor();
if(currentTemp<maxTemp){
digitalWrite(LED, HIGH);
}else if(currentTemp>maxTemp){
digitalWrite(LED, LOW);
}else{}
lcd.setCursor(0, 1);
lcd.print(maxTemp);
}
}
Here are the errors:
ArduinoLcdButtonFunctions:71: error: 'tempsensor' was not declared in this scope
float currentTemp = tempsensor();
^
ArduinoLcdButtonFunctions:72: error: 'maxTemp' was not declared in this scope
if(currentTemp<maxTemp){
^
ArduinoLcdButtonFunctions:74: error: 'LED' was not declared in this scope
digitalWrite(LED, HIGH);
^
ArduinoLcdButtonFunctions:77: error: 'LED' was not declared in this scope
digitalWrite(LED, LOW);
^
ArduinoLcdButtonFunctions:83: error: 'maxTemp' was not declared in this scope
lcd.print(maxTemp);
^
exit status 1
'tempsensor' was not declared in this scope
What can I do to fix this ???
What I have tried:
Ardiuno Forums, Youtube, StackOverFlow forums.