thanks dc42 and liudr for heklping me out
I would use just 2 input pins and a 4-to-16 line decoder, such as a 74HC154.
why not a 3-to 8 since i only have 6 collums to manage, and also one wihtout inverted outputs. but i get the suggenstion thx
note that many mechanical rotary encoders incorporate a pushbutton as well). You will need the diodes whatever hardware you use, because in some states all 3 pins of the encoder are connected together.
i indeed have encoders with pushbuttons, and also bought some diodes to prevent ghost buttons
these pushbuttons are going to be incorperated in a 8x8 button matrix. but could you explain why all 3 pins will be connected together in some states?
your arduino is doing a very heavy main loop, you could try using timer1 library to periodically fire up a rotary encoder sense routine, like every 2 to 10 ms like dc42 suggested.
i think it will do a heavy main loop and ofcourse im gonna do the timer regulation thingy,but not with interupts
a sidegoal of my project is that i will not use interupts to compleet it. Mainly because i always thought of interupts as somewhat unstable. i will however look past my sturdyness if thats the best way to go
add it to a FIFO buffer for your main loop to process. This way you will not likely miss a beat
why should using a FIFO buffer make it less likely to skip a beat? the buffer needs to be prossesed to so there it just takes up some memory,programming time and the encoder response time will be slightly larger
If you instead manipulate variables in the interrupt loop
in the code im not using any interupts yet "rotary_event" is just a crappy choise of words
Another solution is back to kf2qd, use one processor to process these and send back to master
i took a look at the ATtiny45, and made a backup plan for when the matrix does not meet my recuirments. buy 6 ATtiny's(every one controls 2 encoders) and use one serial port(2pins) on the arduino. name the A?ATtiny's A to F and when you need the new value Serial send A , then the ATtiny send back a signed int of how much and in what direction the encoders moved since the last serial checkup. Then reset the 'movement integer' in the ATtiny. but this was al just backup planning
in about a week my encoders will arive, ill keep you guys posted on any problems that will occur. Code that works, and what method i went with