Go Down

Topic: ByVac 4618 I2C LCD/keypad controller (Read 1 time) previous topic - next topic

skipper

Hello.

I bought Byvacs new LCD and keypad I2C conbtroller http://www.byvac.com/bv3/index.php?route=product/product&path=41_42&product_id=100 .
Datasheet: http://www.byvac.co.uk/downloads/datasheets/BV4618%20Datasheet.pdf
UserGuide: http://www.byvac.co.uk/downloads/BV4618/BV4618%20User%20Guide.pdf
ArduinoLib: http://www.byvac.co.uk/downloads/BV4618/BV4618_lcdkey_arduino_lib.zip

I wired it all up (4x20 LCD + 4x4 keypad) and loaded their example code and it all works (if I use int pin 9 as interrupt), but doesn't without int pin, although in userguide says it should (but the proc and i2c bus will be more though loaded, which I don't mind). Any ideas about that?

Though the working example code I would like to print some more stuff on LCD...for example time from RTC.

I tried the following code:
Code: [Select]

  di.puts("Hour Test"); //Prints line on LCD
  int hour;
  hour = RTC.get(DS1307_HR,true);
  di.puts(hour);
  Serial.print(hour); //for test


It prints "Hour Tets" on LCD, and nothing else. On serial monitor I get the correct hour time.
I guess it has something to do with statement in Userguide about "puts" function, that says: "
Sends a string to the i2c bus. The string must be a string, i.e. null
terminated."

I guess, I should somehow convert "hour" to text. Any ideas, how to do that?

This library is a bit hard to read for me... I saw nicely writen lib for Byvac 4218, but have no idea, how to correct it to work with my controller.

Thank you for help in advance.
Bostjan


skipper

Hey,

got it (at least for the puts part).

You can convert integer to a string with itoa command.

For my example, here is a working code:

Code: [Select]

int hour;
hour = RTC.get(DS1307_HR,true);
char hour_str[4]; // Define as a string (4 bytes)
itoa (hour, hour_str, 10); //convert integer to string
di.puts(hour_str); //print string on LCD


It can be also used like this:
Code: [Select]

int hour;
hour = RTC.get(DS1307_HR,true);
char hour_str[4]; // Define as a string (4 bytes)
di.puts(itoa (hour, hour_str, 10)); //convert integer to string and print string on LCD


I'm still scratching my head bout using keypad without interupt pin.
Any help is appreciated
Bostjan

skipper

Guess what?
It's working without a int pin :)
I didn't wire it up using 2 pull up resistors.
With them it works :)

Go Up