28X1 question..

xtech007

Senior Member
I was reading the manual for default or standard variable names. The PICAXE, depending upon its size has 14 to 28 variables: b0, b1, b2, b3 where would i be able to find more detailed info please.

Also how symbols work?
 

westaust55

Moderator
Not sure exactly what more you are looking for.

There are bits, bytes and words available. These overlap so bit bit0 to bit7 equal byte variable b0.
Then byte variables b0 and b1 equal word variable w0 where the lower numbered byte is the least significant in the corresponding word variable.


Have a look at my memory map (Use link below) which also displays the variables. It covers most details for the current PICAXE chips. The inter-relationship of the bits bytes and word variables are shown diagrammatically.
http://www.picaxeforum.co.uk/showthread.php?t=9525&page=2


A bit can only have the values 0 or 1
A byte can have values in the range 0 to 255
A word can have values in the range 0 to 65535.
Values and all maths are positive integer (whole number) only. Cannot have negative


The SYMBOL command is a Programming Editor directive which allows you (the user) to give variables and constants alternative names (aliases) which are more meaningful.

If we define a variable name as:

SYMBOL counter = b0​

And a constant as:

SYMBOL advance = 5​

Then in a program we have some code:

FOR counter = 1 TO 255 STEP advance​

When the program is downloaded into the PICAXE, the Programming editor replaces each instance of the alias/alternate name with the acctual variable name or constant value. Thus the program loaded into the PICAXE will have:

FOR b0 = 1 TO 255 STEP 5​

But your listing of the program will always retain the alternate names you have assigned for ease of understanding/readability.
 
Last edited:

hippy

Ex-Staff (retired)
PICAXE Manual 2 "Basic Commands", page 8 onwards describes the available variables. This can be read from the Programming Editor; click the Help option on the menu bar.
 
Top