<<Previous

Next>>

5. PICBASIC™ Statement Reference

BRANCH Computed GOTO (equiv. to ON..GOTO).
BUTTON Debounce and auto-repeat input on specified pin.
CALL Call assembly language subroutine at specified label.

DEBUG

Debugging statement (Ignored by PBC).

EEPROM

Define initial contents of on-chip EEPROM.

END

Stop execution and enter low power mode.

FOR..NEXT  

Repeatedly execute statement(s).

GOSUB

Call BASIC subroutine at specified label.

GOTO

Continue execution at specified label.

HIGH

Make pin output high.

I2CIN

Read bytes from I2C device.

I2COUT

Write bytes to I2C device.

IF..THEN

GOTO if specified condition is true.

INPUT

Make pin an input.

[LET]

Perform math and assign result to variable.

LOOKDOWN

Search table for value.

LOOKUP

Fetch value from table.

LOW

Make pin output low.

NAP

Power down processor for short period of time.

OUTPUT

Make pin output.

PAUSE

Delay (1mSec resolution).

PEEK

Read byte from PICmicro register.†

POKE

Write byte to PICmicro register.†

POT

Read potentiometer on specified pin.

PULSIN

Measure pulse width (10uSec resolution).

PULSOUT

Generate pulse (10uSec resolution).

PWM

Output pulse width modulated pulse train to pin.

RANDOM

Generate pseudo-random number.

READ

Read byte from on-chip EEPROM.

RETURN

Continue execution at statement following GOSUB.

REVERSE

Make output pin an input or an input pin an output.

SERIN

Asynchronous serial input (8N1).

SEROUT

Asynchronous serial output (8N1).

SLEEP

Power down processor (1 Sec resolution).

SOUND

Generate tone or white-noise on specified pin.

TOGGLE

Make pin output and toggle state.

WRITE

Write byte to on-chip EEPROM.

PICBASIC™ language extension not found in PBASIC.

<<Previous

Next>>