Some more info and code can probably be found in the thread where I'm triggering my D20 rig with hall sensors connected to the temp input:
http://chdk.setepontos.com/index.php?topic=11058.0Seems the easiest way to read the value is to read it directly from the appropriate MMIO which I believe is 0xc090004a. Or you can use the GetAdChValue native call which appears to involve alot more mucking about to set up.
So to read it, you can use
*(short*)0xc090004a. Not sure where you would put the code to be executed constantly, maybe you could get away with putting it in usb_remote.c where it'll get called every 10 milliseconds but I'm sure there's a more logical place to put it though.
On a completely unrelated note, I have a question for the CHDK experts. Is it possible to use CHDK to communicate with an external flash via the hot-shoe? I'm pretty sure that those 4 pins on the hot-shoe are used to communicate data such as brightness and other stuff with the flash right? Well could that be used to communicate data between two cameras with hot-shoes?