Pin Conditionals on X2 parts

Coyoteboy

Senior Member
Dear All,

If pinX then ....

works on lower part numbers, but on the X2 parts (40 in particular) it doesnt seem to like accessing the pins directly. While I know its easy enough to read in the whole port then test the bit, is there a simpler way to access say.... D.2 in an "if D.2 = 1 then ...", or do I have to go through the rigmarole of reading d.2 into a variable and testing that?

Ta!
 

hippy

Technical Support
Staff member
Each pin is now on a named port rather than simply numbered so instead of -

If pin0 = 1 Then

which would read leg 11 of a 28X1 -

If pinC.0 = 1 Then

Now does the equivalent, reads leg 11 of 28X2.
 

hippy

Technical Support
Staff member
One quick way to find what an 'old style' program should become for an X2 is to run it through the X2 Conversion Wizard; PICAXE -> Wizards -> X2 Conversion.
 
Top