Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

need clarifications

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-8051 code here
View previous topic :: View next topic  
Author Message
vinodkumar

Bascom Member



Joined: 18 Oct 2005
Posts: 7
Location: Jabalpur

india.gif
PostPosted: Tue Dec 13, 2005 7:15 pm    Post subject: need clarifications Reply with quote

IF i declare the folowing bit variables as


Do

T1 = P2.2
T2 = P2.3
T3 = P2.4

'some code
Gosub Switch

Loop
End

'Press buttons routine

Switch:
Debounce T1 , 0 , Stevec1 , Sub 'UP
Debounce T2 , 0 , Mod , Sub 'DOWN
Debounce T3 , 0 , Stevec , Sub 'MODE
End If
Return



Do i get the real values of the Ports debounced or the T1, T2, T3. will this be reliable in sensing a switch closure
Back to top
View user's profile Yahoo Messenger
vasan

Bascom Member



Joined: 21 Jun 2004
Posts: 13
Location: Chennai

PostPosted: Thu Dec 15, 2005 10:07 am    Post subject: Key Scanning Reply with quote

You can do like this:



T1 Alias P2.2
T2 Alias P2.3
T3 Alias P2.4
'Do not include the above in the loop
Do
'some code
Gosub Switch

Loop
End

'Press buttons routine

Switch:
Debounce T1 , 0 , Stevec1 , Sub 'UP
Debounce T2 , 0 , Mod , Sub 'DOWN
Debounce T3 , 0 , Stevec , Sub 'MODE
End If
Return

' This should work basically. But if you need to wait until the key 'is 'released then see the application notes of mcs elec where you can find an excellent program.
Back to top
View user's profile Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-8051 code here 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