Hi all
I need help, i have tried to run the program below and i get the above message when i try to "Verify" it, the line
tempPin int = 0, / / ??Declare the analog pin 0 to read the value of the temperature sensor - is highlighted in Yellow.
Can anyone spot mistakes, i am still a novice.
I have copied this sketch from a Portuguese web site, after my PC had translated it.
/ / Project 10 - Temperature control with LCD and Cooler
Include <LiquidCrystal.h>
Include <limits.h>
sensorTemp const int = 0 / / pin in which the analog temperature sensor is connected
int fan = 13; / / declare digital pin 13 to trigger the cooler
tempPin int = 0, / / ??Declare the analog pin 0 to read the value of the temperature sensor
valorSensorTemp int = 0 / / Variable used to read the temperature value
valorTemp int = INT_MAX / / Variable used to store the lowest temperature value
LiquidCrystal lcd (9, 8, 5, 4, 3, 2) / / Creates a LCD object and assign the pins
void setup () {
pinMode (fan, OUTPUT) / / Sets the pin 13 as output
lcd.begin (16, 2), / / ??Sets the display with 16 columns and 2 lines
}
void loop () {
/ * To avoid large variations in reading the component
LM35 6 are done reading is the lowest precedence value read * /
valorTemp = INT_MAX / / Initializing the variable with the largest possible int value
for (int i = 1; i <= 6; i + +) {/ / Reading the value of the temperature sensor
valorSensorTemp = analogRead (sensorTemp);
valorSensorTemp * = 0:54 / / Transforms the value read by the temperature sensor in degrees Celsius approximate
if (valorSensorTemp <valorTemp) {/ / Keeping always read the lowest temperature
valorTemp = valorSensorTemp;
}
delay (100);
}
if (valorTemp> 35) / / Indicates condition to drive the cooler
{
lcd.setCursor (0.1) / / Sets the column 0 and line 1 of the LCD which will print the string
lcd.write ("Fan connected!") / / Prints the LCD
digitalWrite (fan, HIGH) / / When true condition, connects the cooler
}
else
{
lcd.setCursor (0.1);
lcd.write ("Fan off");
digitalWrite (fan, LOW); / / Turns cooler when it is low the valorTemp, indicating that the LCD is off
}
delay (1000);
/ / Displaying the value of the temperature sensor reading on the LCD display
lcd.clear () / / Clears the LCD display
lcd.print ("Temperature:") / / Prints the string on the LCD display
lcd.print (valorTemp);
lcd.write (B11011111); / / Symbol degrees Celsius
lcd.print ("C");
delay (2000); / / Waits 2/2
}