Hi!
I would like to ask for help in an Arduino program. I have an Arduino Leonardo and a rotary encoder, called the ROT-1AB. I want to make a basic program that would press a button on my keyboard depending on the direction of the rotation. So far I have edited a built-in program in the software a little bit and tried it. I have a cruise control handle for a tram simulator. It has a braking (below 0 degree angle) and a speeding function (above 0 degree angle). In it’s default position it should press the Num+5 button on my keyboard. If I extract the „newPosition” from the „oldPosition”, I get the difference. If this number is above 0, it should press the Num+2 button on my keyboard and if this is below 0, it should press the Num+8 button. How do I measure the current position? And how do I active the keyboard buttons?
I attached a picture of my idea!
Thanks for the help in advance!