
Byte Variables:
   port_value    <-- holds current value from the port
   prev_value    <-- holds previous input from port
   edge_value    <-- has computed 1 bits where a rising edge
                     is detected

Edge Detect: (do this in the polling loop)
   port_value <-- port                        ; get 8 inputs
   edge_value <-- port_value AND prev_value   ; coupute edge bits
   prev_value <-- NOT port_value              ; save NOT of port bits
