LCDKeypad 16x2 HD44780 Shield
#1
Posted 06 September 2010 - 09:27 PM
#2
Posted 21 November 2010 - 09:39 PM
#3
Posted 21 November 2010 - 10:17 PM
#4
Posted 02 December 2010 - 05:12 PM
#5
Posted 03 December 2010 - 04:13 AM
#6
Posted 09 January 2011 - 08:52 AM
#7
Posted 10 January 2011 - 03:08 PM
I think using a 12k and an 18k resistor should get you the correct ratio (~1.5 ) to divide 5v down to 3.3v. With the 12k resistor in series on the analog line of the shield buttons, and then after that parallel out the 18k resistor to ground...
lcdboard ----> 12k R ----------> Netduino analog in | | 18k R | Ground
(Hopefully that shows up right..the 18k resistor line is split out after 12k R, before netduino in.)
#8
Posted 10 January 2011 - 03:16 PM
#9
Posted 07 February 2011 - 12:25 AM
However, while debugging I noticed that the voltage levels didn't appear to be in the "expected' range.
From the original code in LCDKeypadDriver.cs
const int ERROR = 15; // may also be 15 or 50
if (i > 1024 - ERROR)
return Keys.None;
if (i < 0 + ERROR)
return Keys.Right;
if (i < 180 + ERROR && i > 180 - ERROR)
return Keys.Up;
if (i < 390 + ERROR && i > 390 - ERROR)
return Keys.Down;
if (i < 580 + ERROR && i > 80 - ERROR)
return Keys.Left;
if (i < 780 + ERROR && i > 780 - ERROR)
return Keys.Select;
return Keys.None;
}
I found my range was 0, 110, 230, 360, 510, 630
Not sure why these are so inconsistant either. I would have expected these to be "scaled" evenly in the 0-1023 range
#10
Posted 07 February 2011 - 12:40 AM
#11
Posted 07 February 2011 - 04:06 AM
Hi
The level converter is not supposed to scale a signal. It is just converting the high logic level to another voltage.
Sparkfun says this: "Does not work with an analog signal."
/Jan Olof
From the schematic there are both Tx and Rx channels. The Rx channel is a simple voltage divider (although it is a 2:1)
#12
Posted 17 July 2011 - 11:41 AM
I've documented a simple mod to this DFRobot LCD Keypad Shield (DFR0009)
The mod gets the keypad working as intended.
http://forums.netdui...-keypad-shield/
I put the appropriate analog values into the code provided at the beginning of this thread.
The thresholds are chosen to be about mid way between one expected value and the next and are typically 90-100 counts from the expected values so it should be quite reliable.
/// <summary> /// Gets an enumeration of the key press at the current time. /// Can only be used if the LCD has been initialised with the true parameter. /// </summary> /// <returns></returns> public static Keys GetKey() { if (!analogInitialised) throw new Exception("Analog input is not Initialised"); int i = AnKey.Read(); if (i > 910)//expected value = 1024 return Keys.None; if (i < 90)//expected value = 0 return Keys.Right; if (i < 290)//expected value = 184 return Keys.Up; if (i < 490)//expected value = 397 return Keys.Down; if (i < 690)//expected value = 578 return Keys.Left; //expected value = 796 return Keys.Select; }
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users