| Main > Main Forum |
| Control to interpret speed as axis/button? (pedal to play!) |
| << < (4/4) |
| brandon:
--- Quote from: Kremmit on April 28, 2006, 05:17:38 am ---Didja ever stick playing cards in your bike's spokes so it sounded like a motorcycle? Just stick a leafswitch in there instead. :laugh2: --- End quote --- ya know.. I think something mechanical like that is actually not a bad idea :) How about something centrifugal attached to the wheel.. something like the governor on a lawn mower. You could attach a poteniometer to a lever.. one side being pulled by a spring the other side being pulled my the centrifugal/governor mechanism. I dunno.. just a thought... :dizzy: |
| hanelyp:
A capaciter + a couple diodes would suffice to turn a pulse train from an encoder into a current proportional to frequency, which could then be treated like the output from an analog joystick. |
| MonMotha:
Depends on the type of encoder he has. Some output a variable duty cycle pulse train. Your method would work for this, though if you've got a microcontroller, why not just measure the duty cycle directly rather than converting it to analog only to convert it right back to a digital value with an A/D? Some output two square waves with fixed duty cycle (almost always 50%) in quadrature. The rate at which the edges come by is the speed at which the device is being turned and you can back direction out from which edge you get on one while the other is constant. You can do this pretty easily on a microcontroller, as well. Using a couple digital IOs on a micro is a more universal (and, in my opinion, probably more reliable and simpler) solution than making things analog. Unless your goal is to hack the input to an existing joystick (which I hate doing - it's bulky, ugly, and tends to be failure prone), a little USB micro is the way to go. That'll let you map pretty much any input even to arbitrary HID events: keypresses, joystick buttons/axes, mouse movements, etc. |
| MinerAl:
A lot of this thread is over my head, so if this is a dumb suggestion, I apologize. Couldn't you just place an "optical" mouse so that it is very close to the spinning bicycle wheel, and then take the axis reading from it? |
| Navigation |
| Message Index |
| Previous page |