Know switch position

This forum is for posts that might be considered off-topic but that may be useful or interesting to members. Examples include posts about electronics or programming in general, other microcontrollers or interesting devices, useful websites, etc.
Post Reply
victorf
Posts: 342
Joined: 01 January 2006, 4:08 AM
Location: Schenectady, New York

Know switch position

Post by victorf »

I have a SPST switch wired to a port such that the port sees 0V if the switch is open and +5V if the switch is closed. When the ZX-24 is initialized there is no way to know which position the switch is in. How do I configure the port as an input? I want to watch the switch until the user sets it to a desired position.

Any enlightenment will be appreciated.

Vic
Vic Fraenckel
KC2GUI
windswaytoo ATSIGN gmail DOT com
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

PutPin sets an I/O pin to input or output. You can poll the pin using GetPin() until it changes state.
Mike Perks
victorf
Posts: 342
Joined: 01 January 2006, 4:08 AM
Location: Schenectady, New York

Post by victorf »

mikep,

I guess I really knew that. :oops: Probably a senior moment. Please disregard the OP

Vic
Vic Fraenckel
KC2GUI
windswaytoo ATSIGN gmail DOT com
Post Reply