Pages: [1]   Go Down
Author Topic: 10.27 Temperature Switch  (Read 446 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: August 14, 2013, 09:00:41 am by AnthonyJ » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25752
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Could you explain the thread title, please, and next time you post code use code tags.
Logged

"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.

London
Offline Offline
Edison Member
*
Karma: 46
Posts: 1368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: