Go Down

Topic: 10.27 Temperature Switch (Read 559 times) previous topic - next topic

AnthonyJ

Aug 14, 2013, 03:22 pm Last Edit: Aug 14, 2013, 04:00 pm by AnthonyJ Reason: 1
I don't seem to be able to get the correct verification for the program given below.
The digital thermometer sensor is LM35CZ/NOPB but I am not sure whether this should be incorporated in the circuit shown at Fig.10.33 on page 205.
As I am a complete beginner I would appreciate some help.

Thanks

AnthonyJ

// Franzis Arduino
// Temperature Switch

int LED=13;
int Uf=0;

void setup()
{
Serial.begin(9600);
pinMode(LED,OUTPUT);
}

void loop()
{
  Uf=analogRead(0);
  Serial.print('Uf = 0);
  Serial.printIn(Uf);
  if(Uf>40)digitalWrite(LED,HIGH);
  if(Uf<20)digitalWrite(LED,LOW);
  delay(250);
 
}

Additionally, I am getting the error message shown below

sketch_aug13a:17: error: missing terminating ' character
sketch_aug13a.ino: In function 'void loop()':
sketch_aug13a:18: error: 'class HardwareSerial' has no member named 'printIn'

Also, as a complete beginner I am not sure what you mean by code tags.
Please explain

AWOL

Code: [Select]
Serial.print('Uf = 0);
should be
Code: [Select]
Serial.print("Uf = 0");
(double quotes)

Could you explain the thread title, please, and next time you post code use code tags.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Henry_Best


Also, as a complete beginner I am not sure what you mean by code tags.
Please explain
Read the 'sticky note', the very first item on the forum.

Go Up