From: Yago F. H. <st...@so...> - 2010-08-13 06:54:03
|
Dear developers: I've tried with picoLCD 2x20 with not very good results in the project I am working in, so I have bought a new LCD module picoLCD Graphic USB 256x64 with better results. This display has 5 buttons that lcd4linux reads right. The problem is that I need to give functionalities to these buttons and have tried to read the whole wiki and using the help and the plugins. I have tried to give a button the function of poweroff using the exec plugin, and to other the function to switch on and off the backlight with the command. LCD::backlight(0) LCD::backlight(1) I have tried to use the command with evaluator as expression button_action=nkey==2?LCD::backlight(0):button_action;nkey==2?1:0 But after killing and restarting lcd4linux begins to run and to send everything to the display until it comes to this line and then exits. My version is: Version 0.10.2-SVN-796 (the one that comes bundled with picolcd) Can you please help me to make it work! Thank you Yago Fernandez Hansen This is the important part of my configuration. Display picoLCD { Driver 'picoLCDGraphic' Size '256x64' Contrast 230 Backlight 1 Inverted 1 Icons 1 } Variables { tick 500 tack 100 minute 60000 n 0 nkey 0 button_text ' ' backlight 1 huaweiT 500 } # Leer las pulsaciones del display LCD Widget TimerW { class 'Timer' expression n=LCD::GPI(1);nkey=n!=0?n:nkey active 1 update tack } Widget GPO_kf1 { class 'GPO' expression button_action=nkey==1?file::readline('/mnt/cfdata/logs/lcd2.txt',1):button_action;nkey==1?1:0 update 100 } Widget GPO_kf2 { class 'GPO' expression button_action=nkey==2?exec('poweroff', 1000):button_action;nkey==2?1:0 update 100 } Widget Button_action { class 'Text' expression button_action width 44 update tack } Layout picoLCD { # Layer 1 { # X0.Y0 'BandwidthImage' # } # Layer 1 { # X0.Y0 'CpuImage' # } Row1 { Col1 'CPULabel' Col6 'CPU' Col11 'CPUBar' Col23 'RAMLabel' Col28 'RAMFree' Col33 'RAMTotal' } Row2 { Col1 'FSSpaceLabel' Col6 'FSSpace' # Col1 'IDELabel' # Col6 'IDEIn' # Col17 'IDEOut' Col23 'ACTLabel' Col28 'IDEBar' } Row3 { Col1 'ETHLabel' # Col6 'ETHIn' # Col17 'ETHOut' Col11 'ETHBar' Col23 'PPPLabel' # Col24 'HuaweiOperator' # Col34 'HuaweiMode' } Row4 { } Row5 { Col1 'WLAN1Label1' Col8 'WLAN1FREQ' Col14 'WLAN1MODE' # Col26 'WLAN1Label3' # Col32 'WLAN1SIGNAL' Col23 'WLAN2Label1' Col30 'WLAN2FREQ' Col36 'WLAN2MODE' # Col26 'WLAN2Label3' # Col32 'WLAN2SIGNAL' } Row6 { Col1 'StatusLCD' } Row7 { Col1 'Button_action' } Row8 { Col1 'Time' Col10 'WSOS' # Col22 'Uptime' # Col1 'Uptime' # Col1 'BottomTicker' } #Layer 2 { # X0.Y0 'ImageTest' #} Timer1 'TimerW' GPO2 'GPO_kf1' GPO3 'GPO_kf2' } Display 'picoLCD' Layout 'picoLCD' Firma válida |