jc,how can I switch backlight on / off ,by software ? , it's getting to hot!
gr
This forum has moved to forum.jeelabs.net - this read-only archive is for reference only!
jc,how can I switch backlight on / off ,by software ? , it's getting to hot!
gr
I tried something , it switches it off ,and when a message to lcd
is send it will be turned on by PortsLCD,my heatsink is now 0K.
gr Joop
------------------------------------------------------------
#include "PortsLCD.h"
#include "RF12.h" // needed to avoid a linker error :(
PortI2C myI2C (2);
LiquidCrystalI2C lcd (myI2C);
enum { MCPIODIR, MCPIPOL, MCPGPINTEN, MCPDEFVAL, MCPINTCON, MCPIOCON,
MCPGPPU, MCPINTF, MCPINTCAP, MCPGPIO, MCPOLAT }; // value 0 - 10
PortI2C myport (2/, PortI2C::KHZ400 /);
DeviceI2C lcdbl (myport, 0x24);
void setup()
{
Serial.begin(57600);
Serial.println("Setup test");
// set up the LCD's number of rows and columns:
lcd.begin(20, 2);
// Print a message to the LCD.
lcd.print("Hello, world!");
}
void loop()
{
Serial.println("LCD test");
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
delay(1000);
backlightoff();
delay(1000);
}
void backlightoff(void)
{
lcdbl.send();
lcdbl.write(MCPGPIO);
lcdbl.write(0x7f);
lcdbl.stop();
}
...
Ah - nice solution!