Clockcount == 0; // a counter to identify which 4017 output (bit position)
lastpress == thispress ; // remember last keypress pattern (16 bit) - useful for monitoring changes and debouncing etc.
thispress == 0; set up new keypress variable (bit pattern of switches)
Toggle(Resetpin); // reset 4017 for '0' output HIGH
inputupdate(datapin); // get the value of the data line (HIGH = keypress, LOW = no keypress)
// and store new value in thispress (16 bit switch image)
Loop until Clockcount = 10 ; {
Clockcount++ // increment clock counter (1,2,3,4,5,6,7,8,9)
Toggle(clockpin); // increment 4017 counter for next output
inputupdate(datapin); // get the value of the data line (HIGH = keypress, LOW = no keypress)
// and store new value in thispress
}
Clockcount == 0; // a counter to identify which 4017 output (bit position)
lastpress == thispress ; // remember last keypress pattern (16 bit) - useful for monitoring changes and debouncing etc.
thispress == 0; set up new keypress variable (bit pattern of switches)
Toggle(Resetpin); // reset 4017 for '0' output HIGH
inputupdate(datapin); // get the value of the data line (HIGH = keypress, LOW = no keypress)
// and store new value in thispress (16 bit switch image)
Loop until Clockcount = 10 ; {
Clockcount++ // increment clock counter (1,2,3,4,5,6,7,8,9)
Toggle(clockpin); // increment 4017 counter for next output
inputupdate(datapin); // get the value of the data line (HIGH = keypress, LOW = no keypress)
// and store new value in thispress
}