View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 2 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: LCD push buttons
PostPosted: Fri Jul 08, 2005 10:55 pm 
Offline
Joined: Fri Jul 08, 2005 2:55 pm
Posts: 5
Location: New Zealand
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 11:00 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Me thinks you should submit this to the mythtv-dev list....

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu