Can you guys help me? these are the codes and at the bottom is the error...plz help
Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float temp;
int tempPin = A1;
#define fan 9
void setup() {
// Giving Fan Currunt....Making Fan Pin 9 For Output
pinMode (fan, OUTPUT);
// Setting LCD's number of rows and columns and rows;
lcd.begin(16,3);
// Printing Message On The lcd
lcd.setCursor(3, 1);
lcd.print("Tech Point");
delay(1000);
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Ray Sarto");
delay(1000)
;lcd.clear();
lcd.print("Come Join Us");
delay(2000);
lcd.clear();
lcd.print("Arduino Based Temperature Regulator");
delay(2000);
}
void loop();
lcd.setCursor(3, 0);
lcd.print("Recording");
lcd.setCursor(2, 1);
lcd.print("Temperature..");
delay(3000);
lcd.clear();
lcd.setCursor(0, 2);
temp = analogRead(tempPin);
temp = temp * 0.48828128; // Converting Temperature
lcd.setCursor(0, 0);
lcd.print("TEMPERATURE = ");
lcd.setCursor(5, 1);
lcd.print(temp); // Printing Temp
delay(3000);
LiquidCrystal.clear();
if(temp <20)
{
analogWrite(9,0);
lcd.print("Fan Off");
delay(2000);
lcd.clear();
}
else if(temp<=24)
{
analogWrite(fan,102);
lcd.print("Fan Speed: 40% ");
delay(2000);
lcd.clear():
}
else if(temp<=26)
{
analogWrite(fan, 153);
lcd.print("Fan Speed: 60% ");
delay(2000);
lcd.clear();
}
else if (temp<=28)
{
analogWrite(fan, 200)
lcd.print("Fan Speed: 80% ");
delay(2000);
lcd.clear();
}
else if(temp>=30)
{
analogWrite(fan,255);
lcd.print("Fan Speed: 100% ");
delay(2000);
lcd.clear();
}
Error:
Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Uno"
yes:39:3: error: 'lcd' does not name a type
lcd.setCursor(3, 0);
^
yes:40:3: error: 'lcd' does not name a type
lcd.print("Recording");
^
yes:41:3: error: 'lcd' does not name a type
lcd.setCursor(2, 1);
^
yes:42:3: error: 'lcd' does not name a type
lcd.print("Temperature..");
^
yes:43:8: error: expected constructor, destructor, or type conversion before '(' token
delay(3000);
^
yes:44:3: error: 'lcd' does not name a type
lcd.clear();
^
yes:45:3: error: 'lcd' does not name a type
lcd.setCursor(0, 2);
^
yes:46:3: error: 'temp' does not name a type
temp = analogRead(tempPin);
^
yes:47:3: error: 'temp' does not name a type
temp = temp * 0.48828128; // Converting Temperature
^
yes:48:3: error: 'lcd' does not name a type
lcd.setCursor(0, 0);
^
yes:49:3: error: 'lcd' does not name a type
lcd.print("TEMPERATURE = ");
^
yes:50:3: error: 'lcd' does not name a type
lcd.setCursor(5, 1);
^
yes:51:3: error: 'lcd' does not name a type
lcd.print(temp); // Printing Temp
^
yes:52:8: error: expected constructor, destructor, or type conversion before '(' token
delay(3000);
^
yes:53:16: error: expected unqualified-id before '.' token
LiquidCrystal.clear();
^
yes:55:5: error: expected unqualified-id before 'if'
if(temp <20)
^
yes:62:5: error: expected unqualified-id before 'else'
else if(temp<=24)
^
yes:69:5: error: expected unqualified-id before 'else'
else if(temp<=26)
^
yes:76:5: error: expected unqualified-id before 'else'
else if (temp<=28)
^
yes:83:5: error: expected unqualified-id before 'else'
else if(temp>=30)
^
yes:95:5: error: expected declaration before '}' token
}
^
exit status 1
'lcd' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.