View previous topic :: View next topic |
Author |
Message |
chingB
Joined: 29 Dec 2003 Posts: 81
|
output_toggle inquiry |
Posted: Mon Mar 08, 2004 6:37 pm |
|
|
Hi,
Can somebody explain on how to use the output_toggle() function?
Thank you. |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Mon Mar 08, 2004 7:50 pm |
|
|
I haven't used this function yet, but as the read me file states, it is used just like output_high(PIN_A0);. As the function name states, I would surmise that this function toggles the pin, i.e., the resulting state of the pin is the inverse of the starting state. Similar to:
#byte port_b = 6
#bit MY_PIN = port_b.0
To toggle the pin:
MY_PIN = !MY_PIN; |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Mar 09, 2004 7:08 am |
|
|
#use fast_io(B)
output_toggle(PIN_B0);
Produce the shortest and fastest way to toggle an output PIN.
Code: |
.................... {
.................... output_toggle(PIN_B0);
019C: MOVLW 01
019D: XORWF PORTB,F
.................... }
|
Humberto |
|
|
|