Go Down

Topic: LCD displayed a very high temperature instead of the one sensed (Read 1 time) previous topic - next topic

abrookfield

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
www.reeftopper.com

floresta

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

Don

monkeyo

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

monkeyo

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);

monkeyo

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.

floresta

#20
Jul 20, 2012, 03:04 pm Last Edit: Jul 20, 2012, 03:06 pm by floresta Reason: 1
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


Go Up