On 6/10/2013 10:03 AM, Manu Abraham wrote: > One thing that I don't understand is, why he does this: " static=20 > uint8_t old_AB =3D 0;" that would loose the previous state altogether,=20 > wouldn't it ?=20 No, the "=3D0" is only assigned when the static old_AB is allocated and=20 initialized, after that, it retains it's value as set by the "old_AB =3D"=20 assignments in read_encoder() Joe W --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .