Go Down

Topic: sparkfun serial lcd help pleasee !!!!!!!!!!!!!!! (Read 764 times) previous topic - next topic


Jan 07, 2013, 10:51 am Last Edit: Jan 07, 2013, 01:01 pm by supermotolew Reason: 1
sorry all again  ! im really over my head with this !! soo please help ! so my sparkfun serial lcd arrived today for my thermometer project my sketch wich i will post below works correctly to display temperature in serial monitor and when i first connected the lcd displayed on the LCD like this


what im trying to acheive is a normal refreshing reading like you would expect to see like this


my sketch as follows

#include <OneWire.h>

int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2

//Temperature chip i/o
OneWire ds(DS18S20_Pin);  // on digital pin 2

void setup(void) {

void loop(void) {
 float temperature = getTemp();
 delay(2000); // delay between output

float getTemp(){
 //returns the temperature from main DS18S20 in DEG Celsius!

 byte data[12];
 byte addr[8];

 if ( !ds.search(addr)) {
     //no more sensors on chain, reset search
     return -1000;

 if ( OneWire::crc8( addr, 7) != addr[7]) {
     Serial.println("Sensor not valid see lewis!");
     return -1000;

 if ( addr[0] != 0x10 && addr[0] != 0x28) {
     Serial.print("Device is not recognized");
     return -1000;

 ds.write(0x44,1); // start conversion, with parasite power on at the end

 byte present = ds.reset();
 ds.write(0xBE); // Read Scratchpad

 for (int i = 0; i < 9; i++) { // need 9 bytes
   data = ds.read();
 byte MSB = data[1];
 byte LSB = data[0];

 float tempRead = ((MSB << 8) | LSB); //using two's compliment
 float TemperatureSum = tempRead / 16;
 return TemperatureSum;



Perhaps this article will help:


It shows how to send commands to position the cursor and clear the screen.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131