Rev 210 |
Go to most recent revision |
Blame |
Last modification |
View Log
| RSS feed
/*********************************************************************************************************************************
* *
* Handling of MK LCD *
* *
* Author: Marcus -LiGi- Bueschleb *
* Project-Start: 9/2007 *
* Mailto: ligi@smart4mobile.de *
* Licence: Creative Commons / Non Commercial *
* Big Up: Holger&Ingo *
*********************************************************************************************************************************/
public class MKLCD
implements Runnable
{
MKCommunicator mk=
null;
public String[] LCD_str
;
public MKLCD
(MKCommunicator _mk
)
{
LCD_str=
new String[4];
mk=_mk
;
new Thread( this ).
start(); // fire up main Thread
}
public void run
()
{
while(true)
{
try {
if (mk.
connected)
{
trigger_LCD
();
}
else
{
}
Thread.
sleep(100); }
catch (Exception e
) { }
}
}
public void handle_lcd_data
(int[] data,
int row
)
{
LCD_str
[row
]=
"";
for(int foo=
0;foo
<20;foo++
)
LCD_str
[row
]+=
(char)data
[foo
];
}
public void trigger_LCD
()
{
try {
int[] params=
new int[3];
params
[0]=act_key
;
params
[1]=
0;
params
[2]=
0;
mk.
send_command(0,
'h',params
);
act_key=
0;
}
catch (Exception e
) { }
}
int act_key=
0;
public void LCD_NEXTPAGE
()
{
act_key=
2;
}
public void LCD_PREVPAGE
()
{
act_key=
1;
}
}