From b505ab981859761a9eae9e820c5a06e2210c5dfc Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 25 Feb 2011 13:17:59 -0500 Subject: Shaving 32 microseconds off of LiquidCrystal::pulseEnable(). --- libraries/LiquidCrystal/LiquidCrystal.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libraries/LiquidCrystal') diff --git a/libraries/LiquidCrystal/LiquidCrystal.cpp b/libraries/LiquidCrystal/LiquidCrystal.cpp index 366ad6c..f05aed8 100644 --- a/libraries/LiquidCrystal/LiquidCrystal.cpp +++ b/libraries/LiquidCrystal/LiquidCrystal.cpp @@ -303,16 +303,16 @@ void LiquidCrystal::pulseEnable(void) { digitalWrite(_enable_pin, LOW); delayMicroseconds(1); - // Enable pulse must be > 450 ns. Value chosen here is the max - // of the following two reports: - // http://forums.leaflabs.com/topic.php?id=640&page=2 + // Enable pulse must be > 450 ns. Value chosen here according to + // the following threads: + // http://forums.leaflabs.com/topic.php?id=640 // http://forums.leaflabs.com/topic.php?id=512 - digitalWrite(_enable_pin, HIGH); - delayMicroseconds(30); + togglePin(_enable_pin); + delayMicroseconds(1); + togglePin(_enable_pin); // Commands needs > 37us to settle. - digitalWrite(_enable_pin, LOW); - delayMicroseconds(45); + delayMicroseconds(42); } void LiquidCrystal::write4bits(uint8 value) { -- cgit v1.2.3