1 (edited by chocochumbo 2008-08-16 12:24:51)

Topic: Cheap hack / Volume Knob

Out of the desire for an easy way to control the volume (or, at least, easier than going control panel > settings > volume > select), I went for a cheap solution that took little skill (which is all I really have with these things).  As a result, there are probably 100 ways to do this better and I'd be glad to hear them.
By sticking a potentiometer between the battery and the daughter card, I'm able to alter the voltage that reaches the chumby.  Using a simple daemon, I can read this from /proc/chumby/battery-voltage-history (which contains raw values of the battery's voltage), convert it to a value from 0 to 99, and send it to /usr/chumby/scripts/chumby_set_volume .  Instant volume knob!

With one million bugs, of course, the most obvious being that as the battery wears down the volume will go with it, and that having a battery installed just for one knob is a little silly.  It's also pretty laggy--you can't (as far as I know) poll the 9V faster than once per second.  Additionally, the voltage wavers a little bit--it never produces more than a 1% change in volume but it's still obnoxious.  A potentiometer with a few discrete states would solve all these problems; you could keep the control calibrated against the voltage, and the lag wouldn't be so confusing, plus the voltage waver would be ignored.