Mike, this is Stamp Basic dialect.
Richard, thanks. This makes more sense now. Yes maybe there is better code for matrix keyboard. I was interested in this because of the debouncing and scanning all at the same time.
Ioannis
Mike, this is Stamp Basic dialect.
Richard, thanks. This makes more sense now. Yes maybe there is better code for matrix keyboard. I was interested in this because of the debouncing and scanning all at the same time.
Ioannis
Last edited by Ioannis; - 27th March 2022 at 14:01.
See the code examples from Les Johnson in second post. I had this book many years ago, now out of print. You can find pdf's copies on google
http://www.picbasic.co.uk/forum/showthread.php?t=21115
If you're able to understand arduino C, look at the arduino matrix keyboard example. Nice FSM implementation https://domoticx.com/arduino-library-keypad/
I did this a long time ago with a 4X4 membrane switch to play messages on an ISD chip.
Low PORTC.7
Pause 1
IF PORTB.4 = 0 Then MESSAGE1
IF PORTB.2 = 0 Then MESSAGE9
High PORTC.7
Low PORTC.6
Pause 1
IF PORTB.4 = 0 Then MESSAGE2
IF PORTB.2 = 0 Then MESSAGE10
High PORTC.6
Low PORTC.2
Pause 1
IF PORTB.4 = 0 Then MESSAGE3
IF PORTB.2 = 0 Then MESSAGE11
High PORTC.2
Low PORTC.1
Pause 1
IF PORTB.4 = 0 Then MESSAGE4
IF PORTB.2 = 0 Then MESSAGE12
High PORTC.1
Low PORTC.0
Pause 1
IF PORTB.4 = 0 Then MESSAGE5
IF PORTB.2 = 0 Then MESSAGE13
High PORTC.0
Low PORTA.0
Pause 1
IF PORTB.4 = 0 Then MESSAGE6
IF PORTB.2 = 0 Then MESSAGE14
High PORTA.0
Low PORTA.1
Pause 1
IF PORTB.4 = 0 Then MESSAGE7
IF PORTB.2 = 0 Then MESSAGE15
High PORTA.1
Low PORTC.4
Pause 1
IF PORTB.4 = 0 Then MESSAGE8
IF PORTB.2 = 0 Then MESSAGE16
High PORTC.4
Bookmarks