I've got an I2C lcd display and I followed a tutorial written for Arduino. It seemed to me that to adapt it to teensy3 I did not need to change any code (shown below), but use pins 18 and 19 to drive lcd. Nothing happens. I see that the lcd is lit and the bottom row of the display shows white squares, but no messages were shown. The tutorial provides a link to download LiquidCrystal_I2C library and it has an object file. Now that I think of this, I guess, the library needs to be compiled for teensy, or is the object file board independent? Any suggestions? And if this should be recompiled, how can I do it?
Thanks.
Code:
/* YourDuino.com Example Software Sketch
LCD Display Blue/Yellow: I2C/TWI Interface
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27
/*-----( Declare Variables )-----*/
void setup() /*----( SETUP: RUNS ONCE )----*/
{
Serial.begin(9600);
lcd.init(); // initialize the lcd
lcd.backlight();
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print("2-Line DISPLAY");
delay(1500);
lcd.setCursor(0, 1);
lcd.print("YourDuino: HI!");
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/*-----( Declare User-written Functions )-----*/
/* ( THE END ) */
Thanks.