From b29cb7f7876f298fd2d010a380485774272179f0 Mon Sep 17 00:00:00 2001 From: FMC Date: Tue, 28 Feb 2012 19:45:04 +0100 Subject: [PATCH] Main release preparation for version 1.2.0. Tested with 4BIT, I2C and 2 WIRE SR. --- LCD.cpp | 2 +- LiquidCrystal_SR.cpp | 5 ++--- .../i2cLCDextraIO_tempLeonardo.ino | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/LCD.cpp b/LCD.cpp index 311805b..95bd5f4 100644 --- a/LCD.cpp +++ b/LCD.cpp @@ -289,7 +289,7 @@ void LCD::createChar(uint8_t location, uint8_t charmap[]) for (int i=0; i<8; i++) { write(charmap[i]); // call the virtual write method - delayMicroseconds(30); + delayMicroseconds(40); } } diff --git a/LiquidCrystal_SR.cpp b/LiquidCrystal_SR.cpp index cb2b5ae..88f2df5 100644 --- a/LiquidCrystal_SR.cpp +++ b/LiquidCrystal_SR.cpp @@ -146,11 +146,10 @@ void LiquidCrystal_SR::shiftIt(uint8_t val) // latch. The shiftregister latch pin (STR, RCL or similar) is then // connected to the LCD enable pin. The LCD is (very likely) slower // to read the Enable pulse, and then reads the new contents of the SR. - fio_digitalWrite_HIGH(_srEnableRegister, _srEnableBit); - waitUsec(1); // enable pulse must be >450ns + waitUsec (1); // enable pulse must be >450ns fio_digitalWrite_SWITCHTO(_srEnableRegister, _srEnableBit, LOW); - waitUsec(40); // commands need > 37us to settle + waitUsec ( 37 ); // commands need > 37us to settle } // PUBLIC METHODS diff --git a/examples/i2cLCDextraIO_tempLeonardo/i2cLCDextraIO_tempLeonardo.ino b/examples/i2cLCDextraIO_tempLeonardo/i2cLCDextraIO_tempLeonardo.ino index 1e9b213..8275f1a 100644 --- a/examples/i2cLCDextraIO_tempLeonardo/i2cLCDextraIO_tempLeonardo.ino +++ b/examples/i2cLCDextraIO_tempLeonardo/i2cLCDextraIO_tempLeonardo.ino @@ -34,6 +34,10 @@ #include #endif +#ifdef _LCD_SR_ +#include +#endif + /*! @defined CHAR_WIDTH @@ -111,6 +115,13 @@ const int CONTRAST_PIN = 9; const int CONTRAST = 65; #endif +#ifdef _LCD_SR_ +LiquidCrystal_SR lcd(3,2,TWO_WIRE); +// | | +// | \-- Clock Pin +// \---- Data/Enable Pin +#endif + // LCD reference variable LCD *myLCD = &lcd; @@ -255,7 +266,7 @@ static void initHW ( void ) pinMode ( STATUS_PIN, OUTPUT ); - myLCD->begin ( 16, 2 ); + myLCD->begin ( 20, 4 ); // Load custom character set into CGRAM // -------------------------------------------------------------------- for ( i = 0; i < charBitmapSize; i++ ) @@ -304,4 +315,4 @@ void loop () drawBars ( tempFilter, 1, 14, '-', '+' ); delay (LOOP_DELAY); -} +} \ No newline at end of file