Positron Compiler Documentation

Toggle

Positron16 · Revision 1.1.3.5 · PDF page 211

Toggle Port.Bit or Variable

Reverses a variable or pin or a variable. If a Port's pin is chosen as the operand, it will first be set to output mode. i.e. Changing 0 to 1 and 1 to 0.

Port.Bit can be any valid Port and Bit combination. Variable {.Bit} can be any valid variable or bit.

PinHigh PORTB.0   ' Set bit-0 of PORTB high
Toggle PORTB.0      ' And now reverse the bit

Toggle Var1.0      ' Reverse bit-0 of Var1
Toggle Var1        ' Reverse the whole of Var1

See also : High, Low.

View original PDF page 211Open page in PDFOriginal PDF page 211