PICAXE-28X2 -Outbyte

fefifo

New Member
I have used the following code successfully for the PICAXE-28X1 chip. How do I modify this code to work for the PICAXE-28X2 as I get a syntax error at 'PINS=Outbyte'?

lookup countum,($BE,$82,$DC,$D6,$E2,$76,$7E,$92,$FE,$F2),Outbyte
PINS=Outbyte
 

Chavaquiah

Senior Member
Use pinsB = Outbyte.

This, of course, assuming you're using Port B.

Better to also configure the Port B pins for output (on the 28X2 they probably default to input pins): let dirsB = %11111111.

When in doubt about this conversions (or to avoid doing it manually), you should use the "X2 Conversion" wizard. You'll find it in the "Picaxe" menu on the Programming Editor.

Code:
#picaxe 28X1
symbol countum=b0
symbol Outbyte=b1
lookup countum,($BE,$82,$DC,$D6,$E2,$76,$7E,$92,$FE,$F2), Outbyte
PINS=Outbyte
Code:
#picaxe 28x2

' Converted by X2 Conversion Wizard Version 2.0.1 (2010r3)

let dirsB = %11111111
let adcsetup = 0

symbol countum=b0
symbol Outbyte=b1
lookup countum,($BE,$82,$DC,$D6,$E2,$76,$7E,$92,$FE,$F2), Outbyte
pinsB=Outbyte
BTW, welcome to the Picaxe forum. And don't be affraid to post your questions on the Active Forum section, rather then the Sandbox... ;)
 
Top