| ??? 01/09/02 07:28 Read: times |
#18466 - RE: This is not the end of it: |
Hi Gallo
I SAID ====== I beleive you are doing an application and your code has to run on it which has many other devices connected for on/off or interface. (that is the case because you have left with only one pin). ====== This means that the relay (an assumed one) is connected to the micro not on the pin same as that of switch and LED. After connecting all the interfacing and relay, Flikweert is left with only one pin :( And now he has to control the relay from that only left port to which the switch is connected. But the problem is that now he has run out of all the ports to allow an LED on a port to indicate the state of the relay. That's why he wants both switch and LED at the same port to control and indicate relay status. So, Relay on one port and (switch + LED on the other port) CLEAR ?? Now read again my posting and you will know why the relay will chatter...... YOU SAID ======== I assumed a "flip-flop" was not allowed if external logic is ok then the problem get easier to solve. Agreed, but do you guarantee that a mechanical switch will not bounce at all ?? Its only because switches bounce we insert debouncing delay in the code. If the code is already loaded enough, its good to use a glue flip flop between the switch and the port. YOU ALSO SAID ============= As to the timer, i think you'll find the LED is somewhat forgiving due to the exponential nature of human perception of illumination so, depending on what else is going on, a "round robin" program loop could work as well. As I already said in my posting that if this is not a case only to pulse illuminate the LED then this might be a part of some real application. So in a real application you would not like to use a loop only to indicate the status of an output. So a timer interrupt would be a better option. Bye Simon |
| Topic | Author | Date |
| Led/Button | 01/01/70 00:00 | |
| RE: Led/Button | 01/01/70 00:00 | |
| RE: Led/Button | 01/01/70 00:00 | |
| RE: Led/Button | 01/01/70 00:00 | |
| RE: This is not the end of it: | 01/01/70 00:00 | |
| RE: This is not the end of it: | 01/01/70 00:00 | |
| RE: This is not the end of it: | 01/01/70 00:00 | |
RE: This is not the end of it: | 01/01/70 00:00 |



