"if then" command question

Celestialsphere

New Member
Hello all,

I am using an old PICAXE 28A chip that I bought about in about 2003! (which I want to keep using).

My question is regarding the 'if then' command.

In the current manual this is the command example:

if pinC.0 = 1 then goto flash

but I have seen people using the example:

if input0=1 then goto flash ;remember the older chips didn't use the new PORT.PIN notation

I can't see where 'input0' is documented rather than the pin designation i.e. pin0 . Can anyone help me on this?


Thank you

Andrew

Melbourne, Australia
 

westaust55

Moderator
The newer M2 and X2 parts use the port.pin method of assignment for the IO pins. Unfortunately, Rev Ed tend to favour the newer chips in the example (otherwise need twice as much space for two examples0.

Ealier chips had in general fixed pins as inputs and separately fixed pins for outputs.
You can use:
IF pin0 = 1 THEN GOTO flash

See the section in PICAXE manual 2 page 22 entitled: "Input / Output Pin Naming Conventions"


a command such as INPUT1 was/is available for the 08 and 08M to set a specified pin as an input.


If it might make life easier using the older 28A chip, you could download this PICAXE Manual 2 V5.2 from 2004 which will omit all the commands available for the X1, X2 and M2 parts and even some "M" parts (14M for example)
 
Last edited:

Celestialsphere

New Member
Thank you for a very comprehensive answer westaus55 !

I was actually going to ask if old manuals are available but you have already answered my question !

Cheers

Andrew
 
Top