Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

How to read Swich value

 
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
appiah212

Bascom Member



Joined: 11 Mar 2009
Posts: 23

usa.gif
PostPosted: Wed Aug 12, 2009 3:38 pm    Post subject: How to read Swich value Reply with quote

Hi everyone

I need help on how to connect swicth to AVR MCU and read wheather the swicth is close or open. Thanks
Back to top
View user's profile Yahoo Messenger
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2165

netherlands.gif
PostPosted: Wed Aug 12, 2009 6:28 pm    Post subject: Reply with quote

Hi,

Check the help for DEBOUNCE, there's all you need to know.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
appiah212

Bascom Member



Joined: 11 Mar 2009
Posts: 23

usa.gif
PostPosted: Tue Aug 18, 2009 9:41 pm    Post subject: Reply with quote

Please kindly show me a circuit diagram of how to connect a switch to AVR input pins. Thank you.
Back to top
View user's profile Yahoo Messenger
Rick-S

Bascom Member



Joined: 08 Jan 2009
Posts: 50

usa.gif
PostPosted: Wed Aug 19, 2009 1:20 am    Post subject: Reply with quote

Go to the main page of MCS Electronics and check out all the examples in the Application Notes section. There are many, many examples of sample programs with supporting schematic drawings. Many of which use switches. Most of the time a switch is simply placed between the pin of the port you plan to use and ground.

Rick
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Wed Aug 19, 2009 1:24 am    Post subject: Reply with quote

See help search for : Newbie problems
Code:
Config Portb = Input
Portb.0 = 1                                                 'pullup we use button to gnd (=0)

Do
 If Pinb.0 = 0 Then
  'what you like to do ehen you push
 Waitms 200
 End If
Loop
End

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
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