??? 02/27/04 16:09 Read: times |
#65634 - re: hyperterminal Responding to: ???'s previous message |
It looks to me like the problem is with your usage of SWT bit. For this to be an input you must write a "1" bit to the output latch. So at start do.... SWT=1;
Now to detect the switch you will be best off if the switch is connected one side to GND and other side to the SWT input. Also from the SWT input provide a pullup resistor of 10K ohms to VCC supply of the processor. IE...connect the switch as shown below: ![]() (Ignore the fact that picture shows 5 switches). To detect the switch look for it going low.....and then at end of the loop do not do SWT=0; You may want to have a wait instead that looks for switch going back high. Michael Karas |