335Views5Replies

Author Options:

Magnetic switch to USB? Answered

Hi, 1st post hope you can help! I'm trying to find a way of getting analog data (from an exercise bike) and store it onto a computer in a text file so I can manipulate it and work out averages etc. I thought of having a magnetic switch on the pedal so that everytime the pedal rotates I can store the time thus giving me the speed. Does anyone know if such a cable already exists or if not how to go about creating one? Also if anyone has a better way of getting the data I'd love to hear from you. Many thanks Adam

5 Replies

user
guyfrom7up (author)2008-09-06

oooooooo!!! I know! Take a keyboard I don't know if you can do this in a batch file, but I know you can do it in C. Make a simple counter so everytime a button is pressed the counter goes up one. Then manually save that number in a txt file or somehow export it

Select as Best AnswerUndo Best Answer

user
whatsisface (author)guyfrom7up2008-09-06

Yeah I'd do that as well. I'd do it in something like flash though, because the actionscript would be easy and it could have a nice GUI =]

Select as Best AnswerUndo Best Answer

user
guyfrom7up (author)whatsisface2008-09-06

didn't even think of flash maybe cause I only vaguely know how to code with batch and C

Select as Best AnswerUndo Best Answer

user
Padlock (author)2008-09-06

Try Google-ing "parallel port input". I don't know much about it, but you maybe could use some vbs to create program that would count the rotations, times it by the circumference of the wheel (If it has a wheel) and divide it by 5280. As for the hardware, just a magnet and a coil of wire, or a reed switch. If you get a reed switch, make sure its rated for high speed switching, too.

Select as Best AnswerUndo Best Answer

user
adamt_069 (author)Padlock2008-09-06

excellent and thanks for the quick reply. I'll give it a try and will let you know once I've played with it a while. Thanks again Adam

Select as Best AnswerUndo Best Answer