Having had a nights sleep following my impulse buy last night I thought I should post a slightly less vague explanation.
I have bought myself a microcontroller on a development board, something I have been tempted to do for a while but have have stayed away from on the grounds of cost and or complexity (nice idea but probably never get it to work stuff).
I changed my mind because I discovered one designed to be easy to use by hobbists and also cheap. Loads of people are using them to make cool little electronic toys and robots. You can find the details here: http://arduino.cc/en/Main/ArduinoBoardDiecimila
and buy them from a UK supplier here: http://www.coolcomponents.co.uk/catalog/index.php
The really high end bike lights that you see with funky little fuel guages or other fancy features or that claim to be microprocessor controlled are using something either identical or very similar to this with their own software running on it. I have linked to the larger development board version, but you can get a super miniature one as well.
Out of the box this has digital input/output pins (for switches and LED's) including some that have built in PWM capability (very useful for dimming things). And some analog sensor inputs (useful for measuring things like battery voltage or temperature). It can also communicate with your PC or run standalone. You can also get all sorts of sensors including a GPS and accelerometer.
I am waiting for mine to be delivered so I can do some experimenting... doing anything more to my bike lights is not my aim right now, but it would be tempting in the future. But I will be able to use it to datalog battery discharge while testing my lights, to get an accurate runtime figure.
I am sure I will do some small scale experimenting with flashing and dimming LED's, but thats about all you can expect from me in the short term.
If anyone else thinks this is cool and wants to have a go and post their results that would be great! The actual software coding to make lights work on this is pretty trivial. You would need a FET to drive high power LED's off the digital outputs of this device though (something I already do in my 555 timer circuit that currently flashes my LED's).