Pages: 1 [2]   Go Down
Author Topic: LCD displayed a very high temperature instead of the one sensed  (Read 1538 times)
0 Members and 1 Guest are viewing this topic.
Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In your latest code, I'm not seeing any LCD clearscreen or any other lcd commands... might want to look into those

The original post had init etc
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your posted code does not match the posted picture but my crystal ball says that you used lcd.println() instead of lcd.print.

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okies. Thanks for all the advices and suggestions. I will try it out.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can check if my these codes got anything wrong because it cant work wirelessly.

This is the Transmitter codes

//#include <LiquidCrystal.h>

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int val = 0;
int temp = 0;

void setup()  {
 
  Serial.begin(9600);
  //lcd.begin(16,2);
 
}

void loop()  {
  val = analogRead(A0);
  temp = val * (5000 / 1024); //degree conversion
 
  //if(temp >= 38) //sense if temperature higher than 38 degree
  {
   // lcd.print('FERVER!!');
   
  }
 
  //else if(temp < 38) //sense if lower than 38 degree
  {
    //lcd.print('OK!!');
  }
 
}

This is the receiver codes.

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int incomingByte = 0;

void setup()
{
  lcd.begin(16,2);
  Serial.begin(9600);
  //pinMode(2, OUTPUT);
  //pinMode(3, OUTPUT);
 
}

void loop()  {
 
  if(Serial.available() > 0 )
  {
    incomingByte = Serial.read();
  }
 
  if(incomingByte >= 25)
  {
    lcd.println("COLD");
    //digitalWrite(2, HIGH);
    //digitalWrite(3, HIGH);
  }
 
  else if(incomingByte < 25)
  {
    lcd.println("FREEZE");
    //digitalWrite(2, LOW);
    //digitalWrite(3, LOW);
  }
 
  lcd.write(incomingByte);
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What I am doing now is to sense the temperature sensor and send it wirelessly to the LCD so that the temperature will be displayed on the LCD.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See reply # 16.  It looks like my crystal ball was correct.

If you try to look for the documentation about lcd.println you won't find any.  There is a reason for that and you are seeing it on your display.


Don

« Last Edit: July 20, 2012, 08:06:41 am by floresta » Logged

Pages: 1 [2]   Go Up
Jump to: