BUG Community

Welcome! Log In

Forums BUGmodules LCD Brightness

Subscribe to LCD Brightness  2 posts, 2 voices

Log in to reply to this topic
 
Jan 12, 2009 7:02am
Img_missing_medium Alphamacaroon 6 posts

Is there any way to adjust the brightness/contrast of the LCD module from code?

Jan 12, 2009 11:55am
Medium Bug Labs team jconnolly 285 posts

Alphamacaroon
Is there any way to adjust the brightness/contrast of the LCD module from code?


Absolutely. It's in the API

http://svn.buglabs.net/svn/!source/7916/bug/trunk/com.buglabs.bug.module.lcd/com/buglabs/bug/module/lcd/pub/ILCDModuleControl.java
(sorry, phpBB hates the exclamation point, so no clicky links)

in com.buglabs.bug.module.lcd.pub.ILCDModuleControl, there is a method setBacklight(int intensity), which takes a value between 0 and 3 to control the backlight intensity.

The code would look something like this (assuming you've gone through the BUG App wizard and chosen com.buglabs.bug.module.lcd.pub.ILCDModuleControl as a service in your app):

public void doStart() {
System.out.println("LCDBacklightDampenerServiceTracker: start");
ILCDModuleControl lcdControl = (ILCDModuleControl) getService(com.buglabs.bug.module.lcd.pub.ILCDModuleControl.class);
try {
lcdControl.setBackLight(0);
Thread.sleep(1000);
lcdControl.setBackLight(1);
Thread.sleep(1000);
lcdControl.setBackLight(2);
Thread.sleep(1000);
lcdControl.setBackLight(3);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
Log in to reply to this topic
Forums BUGmodules LCD Brightness

Powered by Community Engine

Top
Login