Wireless joystick
P!-Ro
Posts: 1,189
I am thinking of using the sx to make a joystick wireless using IR. I know little about sx's so before I jumped into this project head first I wanted to find out if doing this is actually feasible. I need to relay the data of 3 pots and 4 buttons, but my current worry is the sx won't be fast enough to transmit this data at a quick enough pace (a min. of 1/20 of a second, but even that is slow). Think this is a plausible use·for the sx?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
Comments
I've been doing IR transmission lately for DVD and camera control so I reorganized some of those code snippets along with an ADC subroutine that I use -- attached you'll find a program that I'm fairly confident will work "out of the box." I checked the modulation, serial data to LED, and the 50ms burst flag with a scope -- all looks good. Even at 2400 baud you can transmit four bytes in about 17 milliseconds, so your desired throughput is there. There are constants for higher baud rates; start low and work your way up.
Note: Be sure to put a 100-ohm resistor between RA.0 and the IR LED anode.
I'll see what I can do and I'll post what I come up with.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
From what I understand, all I need to do is connect the pots and buttons to the correct pins and it will run, right? If so, than my only question is how exactly the data is transmitted. I need this so I can code my prop to read the output.
Again, thanks for all the help, Jon.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
None of us learn this stuff overnight -- spend some more time and it will come together. I'm on the road and am really not one to give long-winded explanations of working code ( unless it's in my Nuts & Volts column! )
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG