@zander Ron, if I have some code that defines the x_pin for a joystick as input, what would be the equivalent pin on a rotary encoder that would accomplish the same input?
Thanks
@banjobrad2 I just ordered some so have no experience, I would look at Bill's (DBWS) video/blog to see.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@banjobrad2 I think you mean output, a joystick has no electronic input, it translates human input to electronic output. I am unfamiliar with a joystick but can imagine it has a single terminal for X, an encoder is totally different. Maybe this article will help https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
Hi @banjobrad2,
There is no 'universal' definition of the electrical interface of a joystick, but the most common is that of two potentiometers ... one in X direction and the other in the y direction. The circuit 'reading' each potentiometer position supplies a small voltage which is applied across the track of the pot, and the slider 'picks' off a fraction of the applied voltage, the voltage depending upon the position of the slider. Hence the input software will be measuring a voltage (from each pot).
The rotary converters are also provided with a small voltage, but the output consists of two possible voltage levels ... 0 and the applied voltage. Rotating the encoder knob causes the voltages levels to 'flip' and the resulting pulses can be converted into rotation signals.
These two interfaces are completely different and require differing software.
Best wishes,
Dave