A-Z - BASIC Commands - PICAXE (original) (raw)

PICAXE

BASIC Commands Alphabetical List

A
adcconfig Configure analogue input operation
adcsetup Configure analogue input channels
B
backward Drive a motor backwards
bcdtoascii Convert a BCD value to its ASCII (text) representation
bintoascii Convert a numeric value to its ASCII (text) representation
booti2c Copy external program slot to internal program memory
branch Branch to one of a number of named labels
button Detect and debounce a button push
C
calibadc Read the internal voltage reference value
calibadc10 Read the internal voltage reference value with highest resolution
calibfreq Adjust the operating speed of the PICAXE
case Define a section of program code for a 'select' command
clearbit Clear a bit within a variable
compsetup Configure analogue comparators
count Count pulses detected on an input pin
D
daclevel Set an analogue output level
dacsetup Configure analogue output
debug Update the debug display screen
dec Decrement a variable's value by one
disablebod Disable brownout detect
disabletime Prevent the elapsed time variable incrementing
disconnect Prevent the PICAXE accepting program downloads
do Repeat a loop until a certain condition is met
doze Reduce power consumption for a short period of time
E
eeprom Specify values to be loaded to internal data EEPROM
else Alternative code execution for an 'if' command
enablebod Enable brownout detect
enabletime Enable the elapsed time variable to increment
end Terminate program execution
endif Indicate the end of an 'if' command
endselect Indicate the end of a 'select' command
exit Exit from a 'do' or 'for' command loop
F
for Repeat a loop a certain number of times
forward Drive a motor forwards
fvrsetup Configure the on-chip voltage reference
G
get Get a value from scratchpad memory
gosub Call a subroutine
goto Continue program execution from a named label
H
halt Halt a motor
hi2cin Read data from an I2C device
hi2cout Write data to an I2C device
hi2csetup Configure the I2C mode and the I2C bus
hibernate Reduce power consumption for a period of time
high Switch an output pin on
high portc Switch a Port C output on
hintsetup Configure hardware interrupt input pins
hpwm Generate PWM output signals
hpwmduty Set the duty ratio of HPWM generated signals
hserin Receive serial data through the High-Speed Serial In pin
hserout Send serial data out through the High-Speed Serial Out pin
hsersetup Configure the High-Speed Serial interface
hspiin Read data using the High-Speed SPI interface
hspiout Write data using the High-Speed SPI interface
hspisetup Configure the High-Speed SPI interface
I
i2cslave Configure the I2C bus
if Conditionally execute program code
if bit Conditionally execute code depending on a variable bit setting
if pin Respond to the state of an input signal
inc Increment a variable's value by one
infrain Receive an infra-red command
infrain2 Receive an infra-red command
infraout Generate an infra-red command
input Set a pin for receiving input
inputtype Select the electrical characteristics of an input pin
irin Receive an infra-red command
irout Generate an infra-red command
K
kbin Read key press data from a PS/2 keyboard
kbled Control the LEDs on a PS/2 keyboard
keyin Read key press data from a PS/2 keyboard
keyled Control the LEDs on a PS/2 keyboard
L
let Perform a mathematical operation
lookdown Find an item in a list of values
lookup Select an item value from a list
loop Indicate the end of a 'do' command loop
low Switch an output pin off
low portc Switch a Port C output off
N
nap Sleep for a short period of time
next Indicate the end of a 'for' command loop
O
on gosub Select one of a number of subroutines to call
on goto Continue at one of a number of named labels
output Set a pin to produce an output signal
owin Read data from a 1-wire device
owout Write data to a 1-wire device
P
pause Delay for a number of milliseconds
pauseus Delay for a number of microseconds
peek Get a value from PICAXE memory
peeksfr Read data from an internal control register
play Play a pre-defined musical tune
poke Set a value in PICAXE memory
pokesfr Write data to an internal control register
pop Pop a byte from the stack
popram Pop variables from the RAM stack
preprocessor [Pre-processor substitution constants]
pullup Set internal pull-ups for input pins
pulsin Measure the length of a pulse on an input pin
pulsout Generate a pulse on an output pin
push Push a byte to the stack
pushram Push variables to the RAM stack
put Set a value in scratchpad memory
pwm Generate a PWM output signal
pwmduty Set the duty ratio of a PWM signal
pwmout Generate a continuous PWM signal
R
random Set a variable to a random value
read Read a value from internal data EEPROM
readadc Read an analogue input
readadc10 Read a high-resolution analogue input
readdac Read the analogue output
readdac10 Read the analogue output using highest resolution
readfirmware Obtain PICAXE firmware information
readi2c Read data from an I2C device
readinternaltemp Read the internal temperature sensor
readoutputs Determine previously set output levels
readowsn Read the serial number of a 1-wire device
readportc Read Port C inputs
readrevision Obtain the #revision details for a program slot
readsilicon Obtain information on the PICAXE chip type
readtable Get a value from the data table
readtemp Read a DS18B20 temperature sensor
readtemp12 Read a DS18B20 temperature sensor to 0.625C accuracy
reconnect Enable the PICAXE to accept program downloads
reset Reset the PICAXE and restart program execution
restart Restart a program task
resume Resume executing a suspended program task
return Return from a subroutine
reverse Toggle a pin between input and output use
rfin Receive data from an RF receiver module
rfout Send data to an RF transmitter module
run Run the program in another program slot
S
select Select which section of program code to execute
serin Receive serial data through an input pin
serout Send serial data out through an output pin
serrxd Receive serial data through the Serial In pin
sertxd Send serial data out through the Serial Out pin
servo Control a servo
servopos Set the position of a servo
setbit Set a bit within a variable
setfreq Set the operating speed of the PICAXE
setint Set the input conditions which cause an interrupt
setintflags Specify the events which cause an interrupt
settimer Configure the internal timer
shiftin Read data from an SPI device
shiftout Write data to an SPI device
sleep Sleep for a period of time
sound Generate simple sounds
srlatch Configure the hardware SR Latch
srreset Reset the hardware SR Latch
srset Set the hardware SR Latch
stop Stop the program code from continuing
suspend Suspend a program task
swap Swap the values of two variables between each other
switch Switch an output on or off
symbol Give a name to a variable or number value
T
table Specify values for the data table
tablecopy Copy data table values into variables
time Use the elapsed time counter
tmr3setup Configure internal Timer 3
toggle Change an output pin between on and off
togglebit Invert a bit within a variable
touch Read a touch sensor status
touch16 Read a touch sensor signal level
tune Play a sequence of musical notes
U
ultra Measure distance with SRF005 ultrasonic sensor
uniin Read data from a UNI/O device
uniout Write data to a UNI/O device
W
wait Delay for a number of seconds
write Set a value in internal data EEPROM
writei2c Write data to an I2C device
#
#com Set the serial/USB COM port for downloading.
#define Define a name to control conditional compilation
#else Alternative program code include for #ifdef and #ifndef directives
#endif Terminate #ifdef and #ifndef commands
#endmacro End a macro
#endregion End a region
#endrem Terminate a previous #rem directive
#error Force a compilation error to be produced
#freq Specify the current operating speed of the PICAXE being downloaded into
#gosubs Specify the number of GOSUBs allowed
#if Only include program code if a #define value is defined
#ifdef Only include program code if a #define name is defined
#ifdef simulating Only include program code when simulating
#ifndef Only include program code if a #define name is not defined
#include Include program code from another source file
#legacy
#macro Define a macro
#no_data Do not download data EEPROM values
#no_debug Disable debug commands in a program
#no_end Do not include a terminating 'end' command
#no_table Do not download data table values
#picaxe Specify the PICAXE the program code is for
#region Define a code region
#rem Treat subsequent program lines as comments
#revision Specify the revision number in a program slot
#sim Specify simulation model to use
#simspeed Set speed of simulation
#simtask Specify program task to simulate
#slot Specify the program slot the program code will be downloaded into
#terminal Set Terminal display baud rate
#undefine Remove a name previously created with #define