Hi Chris,
So you have 8 dip switches with one switch on each pin of a port. You want the switch being set to ON to be a high or 5vdc. You would have 8- 4.7K or 10K resistors, again one resistor on each pin with the other side of each resistor going to Gnd. These are called "pull down" resistors.
Now to read the value set by the switches simply read the "PortValue".
An example would be:
PortValue VAR BYTE
PortC = PortValue
If PortValue = 127 Then
You can also use "Select Case" instead of the multiple IF .. Then 's
You control when the switches get read with your program. I used this setup once a couple of years ago reading the value of a PC card in a card cage from a dip switch setting.
HTH,
BobK




Bookmarks