Arduino Pro Micro Simracing wheel
7 hours ago, Rothfox said:I found this code and got lucky. now all the Analogue pins also work for buttons presses. the only thing i am missing now, is to get the CTS-288 Encoders to work propperly. The issue i am having is that both left and right get activated when scrolling it eather way. they activate at an offsett. and stay on for one turn. So, I guess i need some code to tell the arduino to not count left as pressed when scrolling right etc, and also something to make the scrolls count as pulses and not as pressed.
I found this https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/ wich seems helpfull. altho idk how to code that at all.
Here is the sketch im using. as to Liberys i think i was using ArduinoJoystickLibery and Encoder1.41. altho i myst be honest about not knowing how liberys work at all..
I don’t think you need a library for using a rotary encoder, just two digital pins, power, and ground. Generally, rotary encoders have two pins pulled high, and then turning the encoder pulls the pins down in a certain order. The order changes depending on which way you’re turning so you need some if statements to decide what to do based on what happens. This video explains it better than I did.
I highly recommend looking at the Arduino reference page, it documents and explains with examples every function and command within arduino and really helps get you off the ground. I also recommend reading up on some basic c++ because that also really helps explain what is going on in your code and helps with the basic syntax. I struggled with that as well when I first started, but once I took a c++ class, it all made sense.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now