📖⚡IF PORTC

Same as normal IF statement, except that all pin references now refer to the PORTC input port.

This command only works on devices that have a PORTC for outputs ( 📖📼Kic28 Pins  & 📖📼Kic40 Pins )

When using this command ALL pin references are to the PORTC port - you cannot mix default input and PORTC input pins in a single statement.

See 📖⚡IF for more details about IF construction.

todo:

Tutorials: Simple Logic Comparing Values

Syntax

IF PORTC Condition THEN

  COMMANDS 

ENDIF


' IF PORTC Example
' IfPortC.txt
' Select Kic40 for this to compile

DO
  ' Test PORTC Pin 1
  IF PORTC PIN0 = 1 THEN

    HIGH PORTC 0
    PAUSE 100

  ENDIF
LOOP

If you need to combine PORTC inputs with default input port then use a nested IF statement like this example:

 

' Combining PORTC with default inputs Example
' PORTC_AND_DEFAULT.TXT
' Select Kic40 for this to compile

DO
  ' Test PORTC Input
  IF PORTC PIN0 = 1 THEN

    ' Test default input
    IF PIN0 = 1 THEN

      HIGH PORTC 0
      PAUSE 100

    ENDIF

  ENDIF
LOOP

Related Commands:

todo: Tutorials: Simple Logic