init command...

rocketdoc

New Member
I kind of understand that the command initializes a register, or a certain setup for hardware. Is there an explanation for the init value in the software manual??
 

westaust55

Moderator
Init: as seen in many PICAXE program listings is not a command but a label and will be seen with a semicolon as a suffix.
Init is short for initialise.
For example:
Code:
init: b2 = 0 ; reset targetbyte
; before the loop
Is is often used, whether returned to (via a GOTO command) again or not to indicate the start of a series of BASIC program commands to initialise hardware and/or PICAXE registers including direction of IO ports.
The the above example byte variable b2 is reset to zero.

See page 6 in PICAXE manual 2 for more informaiotn about labels:
http://www.picaxe.com/docs/picaxe_manual2.pdf

Note also that when power is first applied, any external reset button is pressed, or the RESET command is used, then
the PICAXE firmware jumps to the start of the BASIC program, all variables are reset (cleared to zero), all IO is set as inputs, all stacks such as associated with the GOSUB command are cleared.
 
Top