Hi,
See tip #3:
http://ww1.microchip.com/downloads/e...doc/40040b.pdf
Best regards,
Luciano
Hi,
See tip #3:
http://ww1.microchip.com/downloads/e...doc/40040b.pdf
Best regards,
Luciano
Thanks to both of you,
The Tips & Tricks documentation is cool :-)
I'll have a try with tis stuff.
Roger
Well,
After a few hours trying to get a positiv result, I just got nothing working.
I would like to read two buttons connected to one pin.
The states are "0" and "1". The third "Z" state is not relevant to me here.
To make sure I have an intermediate level, I use a 2 resistor divider like described in the first post.
Currently, I can't get clear "0" or "1" states.
Any idea?
I use PORTB.5 of my PIC16F88 for buttons because it is a TTL input only.Code:OSCCON = %01100000 '4MHz OPTION_REG = %10000000 'D I S A B L E PORTB's Pull-Ups for buttons ANSEL = %00000000 'Disable Analogue Inputs TRISB = %00010000 'Inputs/Outputs PORTB = %00000000 'Drive all ports low MAIN: IF PORTB.5 = 0 THEN PORTB.0 = 1 IF PORTB.5 = 1 THEN PORTB.1 = 1 PAUSE 1000 PORTB.0 = 0 PORTB.0 = 0 Goto MAIN end
Roger
you have PORTB.4 set as input, not PORTB.5Code:TRISB = %00010000 'Inputs/Outputs
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thanks Paul,
It was again far to obvious to me (the tree in the forest story...).
I'll try again tomorrow and let you know.
Thanks a lot.
Roger
Well,
I've still got one led always ON.
In my understanding, I should get a state where no Led is ON.
Is this correct?
Roger
Bookmarks