Go Down

Topic: RTC to 4Bit LCD (Read 2 times) previous topic - next topic

Anachrocomputer

OK, that error message is what you would get if you supply a string (in quotes) when the function is expecting an integer (a whole number).  It probably refers to your line 'lcd.print(":");'.  Now, maybe the member function 'print()' of the object 'lcd' simply doesn't support character strings for some reason?  And you need to use a different member function?  Is there a 'println()' function?  The example code from the Playground seems to use 'printIn' (with an 'I'):

Code: [Select]
#include <LCD4Bit.h>
LCD4Bit lcd = LCD4Bit(1);   //create a 1-line display.
lcd.clear();
delay(1000);
lcd.printIn("arduino");


Is that example correct?

Vancouver Reefer

i have no problem writing text to my display in my main program i have written. I just cant seem to interface the I2C RTC to it.

I cant load up any of the liquidCrystal examples without the compiler coming up with an error message.

mem

The LiquidCrystal library and the LCD4Bit libraries are different. If you have the LCD4Bit example working then stick with that library for now.

Make sure that the  lcd code in the i2c sketch is the same as the working lcd example. Add a line in your setup function to print a string to the lcd  - you can copy the lcd print code from the example sketch that works.

imagitronics

I've never used the LCD library that you're using, but I have been working with the Ds1307 code for the last couple of days.

Try casting the bytes to int before printing them:

Serial.print(int(minute), DEC);
Serial.print(":");

I didn't get compile errors from this, but I did find that Serial.print() would print unreadable characters without the cast to int...

Might help.
Tim

Vancouver Reefer

I tried that Tim and the compiler errors with:

29: error: macro "int" passed 2 arguments, but takes just 1 In function 'void loop()':

:(

Go Up