For people who have a SmartXX v3 and (not tested) LT OPX, I have made a patch which enables you to use the general I/O (GPIO, known as Coffee Cooker).
The ticket number is 4870 (http://www.xbmc.org/trac/ticket/4870).
I've also posted a demonstration video (switching LEDS) on YouTube (http://www.youtube.com/watch?v=mEofMI0mdAc).
You can activate an output with the following command:
System.CoffeeCooker( port, value )
Where port is 0..3 for the port number.
and value is 0 or 1 to switch it off or on.
Direct commands:
(http):http://xbox/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=system.coffeecooker(3,1)
(ftp):site System.CoffeeCooker(3,1)
(python):xbmc.executebuiltin( 'System.CoffeeCooker(3,1)' )
Also in Python, you can use xbmc.getGPIOState(3) to read the current port state, which you can use to highlight a button.
The hardware is simple: it's similar to the PWMControl hardware pins, so if you connect LEDs, you must add a resistor.
The four switches available all switch to ground, which means you have to supply a positive voltage.
In the video I used +5v with 220 ohm resistors on each green LED connected to a rj45 (network) socket, so I can abuse plain network cables :)
Cheers,
Tinux
Thanks for the patch. It will be reviewed following the atlantis release.
cool, this also sounds interesting, if you want to build a "stereo-ambilight" (needs to utilize a external microcontroller for pwm) ;)
will try it out soon...
err.. it was late again last night: "general purpose commands" means "built-in commands"
more..coffeecooker ;)
Thanks for the quick respond.
Note that the patch includes some comments.
I hoped there was a way to let general purpose commands return a value, but I noticed that this would include a callback system. Therefore, I commented the 'else' case out, and made an extra python call.
Also I'm not aware of API calling conventions, so both commands may be subject to change if someone has better names for them.
Cheers,
Tinux
Walking/Running Puppy - Advise needed
GridPanel border
|