Here's a good easy tip for anyone using jumpers in a small space.
Reading three states from one pin.
State Jumper to 0
set to input
Read pin . If 0 then 0
State Jumper to 1
ditto but if 1 then 1
State Jumper Open (i.e. No jumper)
Set to output
Drive pin high
Set to Input
Read... If 1
Set to Output
Drive pin Low
Set to input
Read if 0
If first is 1 and second is 0 then no jumper
(Component values mere suggestions and the faster your process the smaller the cap)
Reading three states from one pin.
State Jumper to 0
set to input
Read pin . If 0 then 0
State Jumper to 1
ditto but if 1 then 1
State Jumper Open (i.e. No jumper)
Set to output
Drive pin high
Set to Input
Read... If 1
Set to Output
Drive pin Low
Set to input
Read if 0
If first is 1 and second is 0 then no jumper
(Component values mere suggestions and the faster your process the smaller the cap)
Attachments
-
17.5 KB Views: 45