LinHES Forums
http://forum.linhes.org/

LCD push buttons
http://forum.linhes.org/viewtopic.php?f=2&t=5247
Page 1 of 1

Author:  g8ecj [ Fri Jul 08, 2005 10:55 pm ]
Post subject:  LCD push buttons

I'm in the process of fitting a 2 line LCD display and I'm going to make use of the 6 keys detailed in lcddevice.cpp to allow operation without having to find the IR remote!!

Examination of the Myth code reveals that the keys A, B, C, D, E & F are used for the functions of Up, Left, Down, Right, Yes & No.

Next, delving into lcdproc shows that these keys are on matrix positions X3, Y0-Y3, & X4, Y0-Y1 which is a bit of a pain as it requires 6 scan lines. This is for the winamp connected HD44780 but the lookup matrix is common for all matrix keypads.

Methinks a code change in libmyth/lcddevice to use A, B, C, D, L & Q so that all keys are in the same X column (X3) and its simple to scan Y0 to Y5 to get all 6 values. This leaves lcdproc alone and only affects MythTv. In fact I think this arragement simplifies the matrix for a Winamp connected keypad in that the diodes aren't required if you only press one key at a time and it only requires 1 pullup resistor. Guess I'll find out soon as I'm busy wiring today
:D

Here's the patch for Myth, as you can see its pretty trivial...

diff -pur mythtv-0.18.1/libs/libmyth/lcddevice.cpp mythtv-0.18.1-new/libs/libmyth/lcddevice.cpp
--- mythtv-0.18.1/libs/libmyth/lcddevice.cpp 2005-02-10 02:49:12.000000000 +1300
+++ mythtv-0.18.1-new/libs/libmyth/lcddevice.cpp 2005-07-08 21:52:07.000000000 +1200
@@ -357,7 +357,7 @@ void LCD::init()
// indicating that "hello" was succesful

sendToServer("client_set name Myth");
- sendToServer("client_add_key ABCDEF");
+ sendToServer("client_add_key "LCD_KEY_STRING);

// Create all the screens and widgets (when we change activity in the myth
// program, we just swap the priorities of the screens to show only the
diff -pur mythtv-0.18.1/libs/libmyth/lcddevice.h mythtv-0.18.1-new/libs/libmyth/lcddevice.h
--- mythtv-0.18.1/libs/libmyth/lcddevice.h 2005-02-05 20:52:26.000000000 +1300
+++ mythtv-0.18.1-new/libs/libmyth/lcddevice.h 2005-07-08 21:50:47.000000000 +1200
@@ -15,8 +15,9 @@ using namespace std;
#define LCD_KEY_LEFT 'B'
#define LCD_KEY_DOWN 'C'
#define LCD_KEY_RIGHT 'D'
-#define LCD_KEY_YES 'E'
-#define LCD_KEY_NO 'F'
+#define LCD_KEY_YES 'L'
+#define LCD_KEY_NO 'Q'
+#define LCD_KEY_STRING "ABCDLQ"

enum CHECKED_STATE {CHECKED = 0, UNCHECKED, NOTCHECKABLE };

--
Robin

Author:  cesman [ Fri Jul 08, 2005 11:00 pm ]
Post subject: 

Me thinks you should submit this to the mythtv-dev list....

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/