hi this is my first time using arduino and I'm currently trying to make a heat sensor based on a value that can be keyed in.
when trying to run half way through, i received an error message that the calculation was not declared.
code:
#include <Wire.h>
#include <LiquidCrystal.h>
#include <Keypad.h>
float tempCelsius; // temperature in Celsius
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
const byte ROWS = 4;
const byte COLS = 4;
char Keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '=', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
Keypad customKeypad = Keypad(makeKeymap(Keys), rowPins, colPins, ROWS, COLS);
long Num1,Num2,Nombor;
char key,action;
boolean result = false;
const int buzzer = 10;
const int Sensor = A0;
void setup()
{
pinMode(Sensor, INPUT);
pinMode(buzzer, OUTPUT);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" Digital ");
lcd.setCursor(0, 1);
lcd.print(" Thermometer ");
delay(4000);
lcd.clear();
}
void loop()
{
float temp_reading =analogRead(Sensor);
float Temp =temp_reading*(5.0/1023.0)*100;
key = customKeypad.getKey();
if (key!=NO_KEY)
DetectButtons();
if (result==true)
CalculateResult();
DisplayResult();
}
void DetectButtons()
{
lcd.clear();
if (key=='*')
{Serial.println ("Button Cancel"); Nombor=Num1=Num2=0; result=false;}
if (key == '1')
{Serial.println ("Button 1");
if (Nombor==0)
Nombor=1;
else
Nombor = (Nombor*10) + 1;
}
error message:
In function 'void loop()':
61:17: error: 'CalculateResult' was not declared in this scope
63:15: error: 'DisplayResult' was not declared in this scope
In function 'void DetectButtons()':
80:5: error: expected '}' at end of input
any help is appreciated