Escolar Documentos
Profissional Documentos
Cultura Documentos
Section 1
Contents
C OMMANDS
AND
SYNT
AX
YNTAX
Introduction .................................................................................................. 2
Comments ...................................................................................................... 3
Constants ....................................................................................................... 3
Symbols ......................................................................................................... 3
Variables ........................................................................................................ 4
Command Summary (A-O) ................................................................................. 5
Commands Summary (P-Z) ................................................................................ 6
backward .................................................................................................. 7
branch ..................................................................................................... 7
button ..................................................................................................... 8
debug ...................................................................................................... 8
eeprom ..................................................................................................... 9
end ........................................................................................................ 1 0
for...next ................................................................................................ 1 1
forward ................................................................................................... 1 1
gosub .................................................................................................... 1 2
goto ...................................................................................................... 1 2
halt ....................................................................................................... 1 3
high ...................................................................................................... 1 3
highA .................................................................................................... 1 3
if...then .................................................................................................. 1 4
infrain .................................................................................................... 1 5
if sensor...then ........................................................................................ 1 6
input ..................................................................................................... 1 6
inputa ................................................................................................... 1 7
lcd ......................................................................................................... 1 7
let ......................................................................................................... 1 8
lookdown ............................................................................................... 1 9
lookup ................................................................................................... 1 9
LOW pin ................................................................................................ 2 0
lowa ...................................................................................................... 2 0
nap ........................................................................................................ 2 0
output ................................................................................................... 2 1
outputa ................................................................................................. 2 1
pause ..................................................................................................... 2 1
pot ........................................................................................................ 2 2
peek ...................................................................................................... 2 3
poke ...................................................................................................... 2 4
pulsin .................................................................................................... 2 4
pulsout .................................................................................................. 2 5
pwm ...................................................................................................... 2 5
random .................................................................................................. 2 5
readadc .................................................................................................. 2 6
read ....................................................................................................... 2 6
readmem ................................................................................................ 2 7
return .................................................................................................... 2 7
reverse ................................................................................................... 2 8
serin ...................................................................................................... 2 8
serout .................................................................................................... 2 9
servo ...................................................................................................... 3 0
sleep ...................................................................................................... 3 1
symbol ................................................................................................... 3 1
sound .................................................................................................... 3 2
switch on ............................................................................................... 3 2
switch off ............................................................................................... 3 3
toggle ................................................................................................... 3 3
wait ....................................................................................................... 3 4
write ...................................................................................................... 3 4
writemem ............................................................................................... 3 5
Contacts ....................................................................................................... 3 6
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
2
Section 1
BASIC mode
This is the original PBASIC syntax for the BASIC Stamp devices, including the Stamp
Microcontroller and Stamp Controller.
PIC16F84A mode
This supports the programming of a PIC16F84A to take the place of a Stamp module.
This also has additional commands to support the pins on PORTA. See the PIC16F84A
datasheet for more information.
PICAXE mode
These are the commands supported by the PICAXE range of controllers.
Assembler mode
These are the commands that can be converted into assembler code via the automatic
sequential BASIC to Assembler feature. See the assembler datasheet for more
information.
The remainder of this section is split into these topics:
Comments
Constants
Symbols
Variables
Commands
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
3
Section 1
COMMENTS
Comments begin with an apostrophe () or semi-colon (;) and continue until the end
of the line. The keyword REM may also be used for remarks.
Example:
high 0 make pin 0 high
high 0 ;make pin 0 high
REM make pin 0 high
CONST
ANT
CONSTANT
ANTSS
Constants can be declared in four ways: decimal, hex, binary, and ASCII.
Decimal numbers are typed directly without any prefix.
Hexadecimal (hex) numbers are preceded with a dollar-sign ($).
Binary numbers are preceded by a percent-sign (%).
ASCII values are enclosed in quotes ().
Examples:
100
$64
%01100100
A
Hello
B1 = B0 ^ $AA
100 decimal
64 hex
01100100 binary
A ascii (65)
Hello - equivalent to H,e,l,l,o
xor variable B0 with AA hex
SYMBOLS
Symbols can be assigned constant values, alias names for variables, and program
addresses. Constant values and alias variable names are assigned by following the
symbol name with an equal-sign (=), followed by the variable or constant.
Symbols can use any word that is not a command. Symbols can contain numeric
characters (flash1, flash2 etc.) but the first character cannot be a numeric (e.g. 1flash)
Program addresses are assigned by following the symbol with a colon (:).
Example:
symbol RED_LED = 7
symbol COUNTER = B0
let COUNTER = 200
LOOP:
high RED_LED
pause COUNTER
low RED_LED
pause COUNTER
goto LOOP
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
4
Section 1
VARIABLES
Modes:
The following sections show the variables which apply to the following modes:
BASIC
The BASIC mode has 16 bytes of RAM organized as 56 variables: 8 words, 16 bytes,
and 32 bits. The 32 bit variables cover the bottom 2 words or 4 bytes.
Words: PORT
W0, W1, W2, W3, W4, W5, W6
Bytes:
PINS, DIRS
B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13
Bits:
PIN0, PIN1, PIN2, PIN3, PIN4, PIN5, PIN6, PIN7 (together equal PINS)
DIR0, DIR1, DIR2, DIR3, DIR4, DIR5, DIR6, DIR7 (together equal DIRS)
BIT0, BIT1, BIT2, BIT3, BIT4, BIT5, BIT6, BIT7 (together equal B0)
BIT8, BIT9, BIT10, BIT11, BIT12, BIT13, BIT14, BIT15 (together B1)
Note that (within BASIC and Extended modes only) B12 and B13 (W6) is used within
GOSUB commands as a stack. It should therefore not be used as a general purpose
register.
Extended
The extended mode supports all the BASIC variables. In addition:
INPUT0, INPUT1 etc. can be used instead of pin0, pin1 etc.
OUTPUT0, OUTPUT1 etc. can be used instead of 0, 1, 2 etc.
PIC16F84A
The PIC16F84A mode supports the extended mode variables, with the following
modification.
PINSA is used instead of B12
DIRSA is used instead of B13
PICAXE
The PICAXE mode supports the extended mode variables, with the following
modification.
INFRA is used instead of DIRS
In addition the PEEK and POKE commands can be used to address other registers.
Assembler
The assembler mode supports the extended mode variables.
In addition the PEEK and POKE commands can be used to address other registers.
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
5
Section 1
revolution
Extended
X
X
X
PIC16F84A
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
PICAXE18
X
X
X
X
X
X
X
X
X
X
X
X
PICAXE28
X
X
X
X
X
X
X
X
X
X
X
X
Assembler
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
copyright 2001
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
6
Section 1
BASIC
X
Extended
X
X
X
X
X
X
X
X
X
X
X
(use pot) (use pot)
X
X
PIC16F84A
X
PICAXE18
X
X
X
PICAXE28
X
X
X
Assembler
X
X
X
(use readadc)
(use readadc)
(use readadc)
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
revolution
copyright 2001
Email: info@rev-ed.co.uk
X
X
X
X
X
X
X
X
X
Web: www.rev-ed.co.uk
COMMANDS
7
Section 1
backward
BACKW
ARD m
otor
CKWARD
motor
motor a on forwards
wait 5 seconds
motor a on backwards
wait 5 seconds
motor A reverse
wait 5 seconds
loop back to start
branch
BRANCH offset,(address0,address1...addressN)
let infra = 0
reset infra variable for PICAXE system
if infra > 0 then test
jump to test if new signal detected
goto loop
else loop back
test:
branch infra,(btn0,btn1, btn2, btn3)
branch to button routines
goto rest
else loop back to start
btn0:
btn1:
btn2:
btn3:
etc.
etc.
etc.
etc.
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
8
Section 1
button
BUTT
ON pin,d
own
state
,d
elay
,r
ate
,bytevari
able
,tar
getstate
,ad
dress
BUTTON
pin,down
ownstate
state,d
,delay
elay,r
,rate
ate,bytevari
,bytevariable
able,tar
,targ
etstate,ad
,add
Example:
loop:
button 0,0,200,100,b2,0,cont
jump to cont unless pin0 = 0
toggle 1
cont:
debug
DEBUG var
Variables can be printed with their current values by simply naming the
variable.
Example:
loop: debug b1
let b1 = b1 + 1
pause 500
goto loop
revolution
copyright 2001
display value
increment value of b1
wait 0.5 seconds
else loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
9
Section 1
eeprom
EEPROM {location},(data,data...)
When using the Stamp modules, data storage builds upward from 0 while
program storage builds downward from 255. When using the PICAXE-18, data
storage builds upward from 0 while program storage builds downward from
128.
When programming FLASH microcontrollers (PIC16F84, PICAXE-28,
assembler) this command is mapped to the FLASH data memory. Therefore
check the upper data memory limit, as the PIC16F84A, PIC16F870, PIC16F872
and PICAXE-28 only have 64 data memory bytes (valid locations 0-63).
Example:
EEPROM 0,(Hello World)
main: for b0 = 1 to 11
read b0,b1
serout 7,T2400,(b1)
next b0
revolution
copyright 2001
start a loop
read value from EEPROM
transmit to serial LCD module
next character
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
10 Section 1
end
END
Sleep terminally until the power cycles (program re-runs) or the pc connects.
Power is reduced to an absolute minimum (assuming no loads are being
driven).
Note: The compiler always places an END instruction after the last line of a
program.
Example:
loop:
let b2 = 15
pause 2000
gosub flsh
let b2 = 5
pause 2000
gosub flsh
end
flsh: for b0 = 1 to b2
high 1
pause 500
low 1
pause 500
next b0
return
revolution
copyright 2001
set b2 value
wait for 2 seconds
call sub-procedure
set b2 value
wait for 2 seconds
call sub-procedure
stop accidentally falling into sub
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
11 Section 1
for...next
FOR variable = start TO end {STEP {-}increment}
NEXT {variable}
Example:
loop: for b0 = 1 to 20
high 1
pause 500
low 1
pause 500
next b0
pause 2000
goto loop
forward
FORW
ARD m
otor
FORWARD
motor
revolution
copyright 2001
motor a on forwards
wait 5 seconds
motor a on backwards
wait 5 seconds
motor A reverse
wait 5 seconds
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
12 Section 1
gosub
GOSUB address
Example:
loop:
let b2 = 15
pause 2000
gosub flsh
let b2 = 5
pause 2000
gosub flsh
end
flsh: for b0 = 1 to b2
high 1
pause 500
low 1
pause 500
next b0
return
set b2 value
wait for 2 seconds
call sub-procedure
set b2 value
wait for 2 seconds
call sub-procedure
stop accidentally falling into sub
goto
GOTO address
Go to address.
- Address is a label which specifies where to go.
Example:
loop: high 1
pause 5000
low 1
pause 5000
goto loop
revolution
copyright 2001
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
13 Section 1
halt
HAL
otor
HALTT m
motor
motor a on forwards
wait 5 seconds
motor a on backwards
wait 5 seconds
motor A reverse
wait 5 seconds
loop back to start
high
HIGH pin
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
highA
HIGHA pin
revolution
copyright 2001
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
14 Section 1
if...then
IF variable ?? value {AND/OR variable ?? value ...} THEN address
?? can be =, <>, =>, =<, >, <
revolution
copyright 2001
switch on output 1
wait 5 seconds
switch off output 1
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
15 Section 1
infrain
INFRAIN
1
2
3
4
5
6
then
then
then
then
then
then
swon1
swon2
swon3
swoff1
swoff2
swoff3
high 1
goto loop
high 2
goto loop
high 3
goto loop
low 1
goto loop
low 2
goto loop
low 3
goto loop
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
16 Section 1
if sensor...then
NB: This is a special pseudo command that was developed for the Higher Still
Technological Studies Inputs Module when used with the Stamp Controller
module. If you are not using this module you should use the POT or READADC
command instead.
IF SENSORA ?? value {AND/OR variable ?? value ...} THEN address
?? can be =, <>, =>, =<, >, <
switch on output 1
wait 5 seconds
switch off output 1
loop back to start
input
INPUT pin
revolution
copyright 2001
make
make
make
make
pin
pin
pin
pin
input
output
input
output
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
17 Section 1
inputa
INPUT
A pin
INPUTA
lcd
LCD
LCD
LCD
LCD
({#}data,{#}data...)
clear
line1
line2
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
18 Section 1
let
{LET} variable = {-}value ?? value ...
??:
+
*
**
/
//
MAX
MIN
&
|
^
&/
|/
^/
;add
;subtract
;multiply (returns low word of result)
;multiply (returns high word result)
;divide (returns quotient)
;divide (returns remainder)
;make less than or equal to
;make greater than or equal to
;and
;or
(typed as SHIFT + \ on UK keyboard)
;xor (typed as SHIFT + 6 on UK keyboard)
;and not
;or not
;xor not
rest: let b0 = 10
goto loop
reset b0 to 10
loop back to start
revolution
copyright 2001
increment b0
make a sound
after 50 reset
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
19 Section 1
lookdown
LOOKDOWN target,(value0,value1...valueN),variable
Get targets match number (0-N) into variable (if match found).
-
Example:
rest: let infra = 0
reset infra variable
loop: if infra > 0 then test
jump to test if new signal detected
goto loop
else loop back
test:
lookdown infra,(1234),b0
put the ascii character 1 to 4 into b0
lookup
LOOKUP offset,(data0,data1...dataN),variable
Example:
loop: let b0 = b0 + 1
lookup b0,(1234),b1
if b0 < 4 then loop
end
revolution
copyright 2001
increment b0
put ascii character into b1
loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
20 Section 1
low
LOW pin
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
lowa
LOW
A pin
LOWA
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
nap
NAP period
Period is a variable/constant which determines the duration of the reducedpower nap. The duration will be 2^period * ~18ms. Period can range from
0 to 7.
Example:
loop: high 1
nap 4
low 1
nap 7
goto loop
revolution
copyright 2001
switch on output 1
nap for 2^4 x 18ms
switch off output 1
nap for 2^7 x 18ms
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
21 Section 1
output
OUTPUT pin
make
make
make
make
pin
pin
pin
pin
input
output
input
output
outputa
OUTPUT
A pin
OUTPUTA
pause
PAUSE millisecon
ds
milliseconds
Pause for some time. The duration of the pause is as accurate as the resonator
time-base, and presumes a 4MHz resonator.
-
Example:
loop: high 1
pause 5000
low 1
pause 5000
goto loop
revolution
copyright 2001
switch on output 1
wait 5 seconds
switch off output 1
wait 5 seconds
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
22 Section 1
pot
NB: See also the READADC command.
POT pin,scale,variable
Digitize a 5-50K ohm pot with a .1uf cap and scale result. This is a method of
analog input via a pin. The pin must connect to the center- tap of the pot,
whose side tap connects to the cap which connects to ground. Use the StampPot menu command to determine the scale, while the stamp module is
connected and the pot circuit is in place.
-
Scale is a constant (0-255) which is used to scale the initial result by n/256
(result is then limited to 255).
Example:
loop: pot 3,20,b1
if b1 > 50 then flsh
goto loop
flsh: high 1
pause 5000
low 1
goto loop
revolution
copyright 2001
switch on output 1
wait 5 seconds
switch off output 1
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
23 Section 1
peek
PEEK location,variable
Read FSR location contents into variable. This allows use of registers not
defined by b0-b13.
-
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
24 Section 1
poke
POKE location,data
Write data into FSR location. This allows use of registers not defined by b0-b13.
-
pulsin
PULSIN pin,state,variable
Example:
pulsin 3,1,b1
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
25 Section 1
pulsout
PULSOUT pin,time
Example:
loop: pulsout 4,150
pause 20
goto loop
pwm
PWM pin,d
uty
,cycles
pin,duty
uty,cycles
Output pwm then return pin to input. This is used to output analog voltages
(0-5V) via a pin connected to a resistor connected to a cap connected to ground;
the resistor-cap junction being the analog output.PWM should be executed
periodically to update/refresh the analog voltage.
-
Example:
loop: pwm 4,150,20
pause 20
goto loop
random
RANDOM wordvariable
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
26 Section 1
readadc
READADC channel,variable
switch on output 1
wait 5 seconds
switch off output 1
loop back to start
read
READ location,variable
Read eeprom location contents into variable. location 255 holds highest
location minus one that is available to user for data storage.
- Location is a variable/constant specifying a byte-wise address (0-255).
- Variable receives the data byte read.
When using the Stamp modules, data storage builds upward from 0 while
program storage builds downward from 255. When using the PICAXE-18, data
storage builds upward from 0 while program storage builds downward from
128.
When programming FLASH microcontrollers (PIC16F84, PICAXE-28,
assembler) this command is mapped to the FLASH data memory. Therefore
check the upper data memory limit, as the PIC16F84A, PIC16F870, PIC16F872
and PICAXE-28 only have 64 data memory bytes (valid locations 0-63).
Example:
loop: for b0 = 0 to 63
read b0,b1
serout 7,T2400,(b1)
next b0
revolution
copyright 2001
start a loop
read value into b1
transmit value to serial LCD
next loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
27 Section 1
readmem
READMEM location,variable
start a loop
read value into b1
transmit value to serial LCD
next loop
return
RETURN
flsh: for b0 = 1 to b2
high 1
pause 500
low 1
pause 500
next b0
return
revolution
copyright 2001
set b2 value
wait for 2 seconds
call sub-procedure
set b2 value
wait for 2 seconds
call sub-procedure
stop accidentally falling into sub
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
28 Section 1
reverse
REVERSE pin
make
make
make
make
pin
pin
pin
pin
input
output
input
output
serin
SERIN pin,bau
dmod
alifi
er
,qu
alifi
er
...)
pin,baud
odee,(qu
,(qualifi
alifier
er,qu
,qualifi
alifier
er...)
er
,qu
alifi
er
...),{#}vari
able
,{#}vari
able
...
SERIN pin,bau
alifi
...),{#}variable
able,{#}vari
,{#}variable
able...
pin,baud
odee,(qu
,(qualifi
alifier
er,qu
,qualifi
alifier
er...),{#}vari
dmod
SERIN pin,baudmode,{#}variable,{#}variable...
true input
true input
true input
true input
inverted input
inverted input
inverted input
inverted input
Variable(s) receive the result(s) (0-255). Optional #s are for inputting ascii
decimal numbers into variables, rather than raw characters.
Example:
loop: for b0 = 0 to 63
serin 6,T2400,b1
write b0,b1
next b0
revolution
copyright 2001
start a loop
receive serial value
write value into b1
next loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
29 Section 1
serout
SEROUT pin,baudmode,({#}data,{#}data...)
true output
true output
true output
true output
inverted output
inverted output
inverted output
inverted output
true output
true output
true output
true output
inverted output
inverted output
inverted output
inverted output
always driven
always driven
always driven
always driven
always driven
always driven
always driven
always driven
open-drain
open-drain
open-drain
open-drain
open-source
open-source
open-source
open-source
Example:
loop: for b0 = 0 to 63
read b0,b1
serout 7,T2400,(b1)
next b0
revolution
copyright 2001
start a loop
read value into b1
transmit value to serial LCD
next loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
30 Section 1
servo
SERVO pin,pulse
revolution
copyright 2001
move
wait
move
wait
move
wait
loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
31 Section 1
sleep
SLEEP seconds
Sleep for some seconds (resolution is ~2.3s, accuracy is ~99.9%). Power
consumption is reduced to 1/100th normal (if no loads are being driven).
-
Example:
loop: high 1
sleep 10
low 1
sleep 100
goto loop
switch on output 1
sleep for 9.2s
switch off output 1
sleep for 98.9s
loop back to start
symbol
SYMBOL symbolname = value
Example:
symbol RED_LED = 7
symbol COUNTER = B0
let COUNTER = 200
loop: high RED_LED
pause COUNTER
low RED_LED
pause COUNTER
goto LOOP
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
32 Section 1
sound
SOUND pin,(note,duration,note,duration...)
Play notes with durations. The pin must connect to a piezo transducer, or a
speaker and 10uf electrolytic capacitor. The transducer connects between the
pin and ground.
-
Example:
loop: let b0 = b0 + 1
sound 7,(b0,50)
goto loop
increment b0
make a sound
loop back to start
switch on
SWITCH ON pin
SWITCHON pin
revolution
copyright 2001
switch on output 7
wait 5 seconds
switch off output 7
wait 5 seconds
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
33 Section 1
switch off
SWITCH OFF pin
SWITCHOFF pin
switch on output 7
wait 5 seconds
switch off output 7
wait 5 seconds
loop back to start
toggle
TOGGLE pin
revolution
copyright 2001
toggle output 7
wait 1 second
loop back to start
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
34 Section 1
wait
WAIT secon
ds
seconds
switch on output 7
wait 5 seconds
switch off output 7
wait 5 seconds
loop back to start
write
WRITE location,data
revolution
copyright 2001
start a loop
receive serial value
write value into b1
next loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
35 Section 1
writemem
WRITEMEM location,data
Write FLASH program memory data into location. Provides additional 256
bytes storage space to the read command for PIC16F87x devices (including
PICAXE)
- Location is a variable/constant specifying a byte-wise address (0-255).
- Data is a variable/constant which provides the data byte to be written.
Example:
loop: for b0 = 0 to 255
serin 6,T2400,b1
writemem b0,b1
next b0
revolution
copyright 2001
start a loop
receive serial value
write value into b1
next loop
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk
COMMANDS
36 Section 1
CONT
A CT
CONTA
CTSS
The latest version of the Programming Editor can be downloaded from the following
website:
www
.r
ev-ed
.co.uk
www.r
.rev-ed
ev-ed.co.uk
A forum for the discussion of PIC and Stamp projects, and for technical support, also
exists at this site.
Contact Addresses:
Parallax, Inc
3805 Atherton road, #102, Rocklin, CA 95765, USA
http://www.parallaxinc.com/
revolution
copyright 2001
Email: info@rev-ed.co.uk
Web: www.rev-ed.co.uk