News for hackers. Stuff that matters.
Re:A closer look at Raspberry Pi RP2040 Programmable IOs by tekromancr on Tuesday February 16, 2021 @02:10PM (#26157552)
Don't you need more states, or an invalid state state to account for bounces?
Re:A closer look at Raspberry Pi RP2040 Programmable IOs by dragontamer on Tuesday February 16, 2021 @02:21PM (#26157669)
Due to the grey-code methodology, a bounce will be interpreted as a "+1" followed by a "-1". (or alternatively: a -1 followed by a +1) in all situations.

Ex: 00 -> 10 -> 00 is interpreted as 0 -> 3 -> 0, or -1 transition then a +1 transition.

01 -> 11 -> 01 is interpreted as 1 -> 2 -> 1, or +1 followed by a -1 transition.

All possible combinations of bounces (00 -> 01 -> 00, 00 -> 10 -> 00, 01 -> 11 -> 01, 01 -> 00 -> 01, etc. etc.) have this +1 / -1 or -1/+1 property.