I am trying to code a rotary encoder to use it for the multiple degrees of rotation for an x axis so i can program it as a steering wheel is there any guidance that you can give me to doing this my encoder only has 2 outputs x and y how would i use this for my project the ppr is 600
Make it easier to help you by posting a data sheet for the encoder. We need to know if it is a quadrature encoder and if the output is open collector or not, at least.
Post your best attempt at the code. What does the code actually do? How is that different from what you want?
Read the forum guidelines to see how to post code.
sgbsuitelife:
my encoder only has 2 outputs x and y
Read that as "Clock" and "Data". The sketch must check for the rising edge of Clock, and read the value of Data on that moment. LOW means the encoder was rotated right, HIGH means left. Or the other way around.
NB.: Clock and Data are identical, they only differ in phase.
this is all that i have on the encoder
It is a quadrature encoder with an open collector output. You can use the internal pullup for the pullup resistor.
The Encoder library can make using them easier.
how would i do that
Do what?
Didn't the links that I posted help at all?
learning to program is a bit more than asking
"can somebody post the cheatcode for game XY to reach the platinum-level?"
You can ask as many questions as you like. To get helping answers the questions have to be concrete.
You first question was concrete. If you start reading
did you visit the link encoder library? If yes I guess there might be a lot of concrete questions
so simply start with the first concrete question it really doesn't matter what ever this first question is. Just ask a concrete question.
The generalised question "how would I do that?" sounds like a diplomatic hidden way of saying "can somebody post the ready to use code for my project?"
I guess this is not what you intended. But it sounds like this. We (all other forum-members) have no glas-sphere to look in:
-
what your questions are.
-
what programming-knowledge you already have is
-
at which point you want to start (electrical connection or programming, etc.)
you have to provide more information and one easy way to do this is to ask concrete questions
best regards Stefan