I'd go for the interrupt setup like @SimonGAndrews shows. You will get a better overall behavior than you get with polling, especially when you plan to do also additional things in our application. First it may look more complicated, but in the end it will be much simpler. You obviously still have to do a comparison what has changed since you always get all bits back.
© Espruino, powered by microcosm.
Report a problem