I decided to fit a white LED in the frame above the LCD to light up the keyboard. And I wanted it to be software controlled - I need to be able to switch it on and off without an external switch.
To do this I have fitted a PCF8574 I2C IO expander to the SMBus on the eeePCs motherboard.
It's worked out pretty well! My eeePC is now pretty tricked out with an extra 4 gigs of internal flash, internal bluetooth and a keyboard light! (see http://forum.eeeuser...id=25175#p25175.
Here's how I fitted the LED into the frame of the LCD. I drilled a hole through at an angle so the LED would shine on the keyboard. It's fixed down with hot melt glue. I had to sand the LED down a bit to let the eee close fully.
This is how I routed the cables (the blue ones) through the hinge. I used a bit of PVC sleeving to prevent the cables getting damaged in the hinge. The two wires go down the same hole as the fan wires and into the miniPCIe expansion area.
An easy place to tap into the SMBus is on the EEPROM chip on the memory module, I did try the SMBus connections on the miniPCIe expansion connector but had no luck. They had signals on but not the ones I was expecting!
This is the miniPCIe expansion bay. You can see my 4g USB flash drive and bluetooth adapter. The chip wired like a dead bug is the PCF8574 I2C IO Expander. The two blue wires go to the LED. The anode is wired to 3V, the cathode to P4 of the PCF8574. The other connections to the PCF8574 are 3V, ground, SDA, SCL and 3 address line pulled to 3V.
This is what the outside of the lcd frame looks like with the LED poking out. The black tape prevents the LED blinding me while I'm working. It's not too pretty but it's OK with me!
Light on! (It's not easy to see from the photo but the keyboard has enough light to use easily).
Now for the software side.
I compiled the PCF8574 module from the ASUS source tree and installed it. I needed these modules:
modprobe i2c-dev modprobe i2c_i801 modprobe pcf8574Now, to control the LED I wrote this script:
#!/bin/sh LIGHTSTATE=`cat /sys/bus/i2c/drivers/pcf8574/0-0027/read` if [ $LIGHTSTATE = "255" ]; then echo 239 > /sys/bus/i2c/drivers/pcf8574/0-0027/write else echo 255 > /sys/bus/i2c/drivers/pcf8574/0-0027/write fiEach time it is run it toggles the state of the LED.
I have bound it the the key combination Ctrl-Alt-L by adding this to my ~/.icewm/keys file:
key "Alt+Ctrl+l" sudo kblighttoggleSo now when I hit ctrl-alt-L the light comes on or goes off.
Edited by tristand, 29 November 2007 - 08:51 PM.