Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

8*6 matrix keyboard

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
EKREMhbx

Bascom Member



Joined: 06 Jun 2005
Posts: 27

PostPosted: Thu Oct 13, 2005 9:35 am    Post subject: 8*6 matrix keyboard Reply with quote

hello

I want to make 8*6 matrix keyboard whi my m32

so

- config porta=output ' use 8 pin for column output
- config portc = input ' use 6 pin for row (portc 2 to portc 7) input

set portc


do
reset porta.1
waitms 10
lcd pinc
set porta
"
"
"
"
"loop

my program flow is below but I dont recognize wright button code
what is the wrong
I need help

thank you
Back to top
View user's profile
DToolan

Bascom Member



Joined: 14 Aug 2004
Posts: 1384
Location: Dallas / Fort Worth, Texas (USA)

blank.gif
PostPosted: Fri Oct 14, 2005 12:04 am    Post subject: Reply with quote

I'm not sure what your exact problem is (I'm guessing english is not your native language), but the "SET" keyword is used for individual bit manipulation only. Although Bascom accepted your attempt to "SET" an entire port (and it compiled without error), it does not do that. You can't "SET" a byte or a port... only individual bits. The same is true for the keyword "RESET".

For your ports, you should use something like PortC = &HFF or PortA = &HFF. Your use of "Reset PortA.1" for a single bit is correct.
Back to top
View user's profile Yahoo Messenger
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1198
Location: France

france.gif
PostPosted: Fri Oct 14, 2005 6:42 pm    Post subject: Reply with quote

Hi,
Try this one and look at the idea to keep the result "Memoire_clavier" variable, a loop into a loop.
Very low noisy keyboard and debounce perfect!

I use a 4 X 3 matrix keyboard where the user needs to "up" the key before the result is sending
The pin Portc.3 is use to drive a buzzer so take care about it
----------------------------------------------------------------------------
Function Key() As Byte
Local Cle As Byte , Ligne As Byte , Memoire_clavier As Byte

Do
Encore3:
Ddrc = &B00000111 'configuration des ports colonnes
Portc = 7 'envoi 1 sur les 3 colonnes
Cle = Pinc 'lit les lignes
' Locate 6 , 1 : Lcd "cle ligne " ; Cle
Select Case Cle
Case 23 '31 without buzzer
Ligne = 1
Case 39
Ligne = 4 ' Ligne 2
Case 71
Ligne = 7
Case 135
Ligne = 10
Case Else
Goto Encore3
End Select
Waitms 50
'Wait 1
Ddrc = &B11110000 'configuration des ports lignes
Portc = 240
Cle = Pinc
' Locate 7 , 1 : Lcd "cle colonne " ; Cle
Memoire_clavier = Cle
Select Case Cle
Case 241
Key = Ligne + 1
Case 242
Key = Ligne + 2
Case 244
Key = Ligne + 3
Case Else
Goto Encore3
End Select
Do
Cle = Pinc 'si la touche est toujours enfoncée on boucle
Loop Until Cle <> Memoire_clavier
Loop Until Key > 1
Cle = Lookup(key , Clavier)
Key = Cle
End Function

Clavier:
Data 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 100 , 0 , 200

Bon courage

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
EKREMhbx

Bascom Member



Joined: 06 Jun 2005
Posts: 27

PostPosted: Sat Oct 15, 2005 8:48 am    Post subject: 8*6 k&#305;eyboarsd for m32 Reply with quote

thank you for your answer

I want to how I acan adaptive your code
in my 8*6 matrix keyboard project (port c row*8and porta column*6)
in this time gor one column and one row enough for me.

regards
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum