izua
Member level 3
I need an "interface" so to say, for the PIC pins, though I might use it at something else too.
Basically, it should have a led and a button.
If the pin is an output, the led should light up depending on the pins state. Pushing the button wouldn't affect it, nor make any problems.
If the pin is an input, the button will 'set' a state on the pin (though it's incorectly said this way). So if i'll press the button, the pin will be read as a value. If it's depressed, another value will be read. The PIC also has configurable (weak) pull up resistors. It would be nice if the led would light up too, when the button is pressed (or another led, for the instance)
I've tried designing a few circuits, but everytime the button is either shorting the pin when it's an output, or it's not setting a value at all when it's an input. any help? thanks!
Basically, it should have a led and a button.
If the pin is an output, the led should light up depending on the pins state. Pushing the button wouldn't affect it, nor make any problems.
If the pin is an input, the button will 'set' a state on the pin (though it's incorectly said this way). So if i'll press the button, the pin will be read as a value. If it's depressed, another value will be read. The PIC also has configurable (weak) pull up resistors. It would be nice if the led would light up too, when the button is pressed (or another led, for the instance)
I've tried designing a few circuits, but everytime the button is either shorting the pin when it's an output, or it's not setting a value at all when it's an input. any help? thanks!