I plan to learn the source code when I have some free time in a while and try to solve this problem (since I don't have a hardware background myself, I actually find it a bit difficult, though you say it's easy).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well but does it work? I did not test it.