basic code unknown symbol

novolts

Senior Member
Hi

 Hi Guys
I have cut and pasted the code below directly from the manual to P.E when I check the code it comes up " unknown symbols pins "
any advice would be appreciated
HAPPY & PROSPEROUS TO ALL
thanks novolts

This code example counts through the digits 0 to 9

main: for b1 = 0 to 9 ‘ Set up a for...next loop using variable b1

let pins=b1 ‘ Output b1 onto the four data lines

pause 1000 ‘ Pause 1 second

next b1 ‘ Next

goto main ‘ Loop back to start
 

Circuit

Senior Member
Ref Manual 2 Pages 141-142.
I suspect that your simulator is set for an M2 or X2 PICAXE which will return the message that you got.
The format 'let pins = " only applies to older chips. If you select one of these in the simulator then the error will go away.
Alternatively, for M2 and X2 chips you need the syntax "let pinsA ... " etc.
 

westaust55

Moderator
As Circuit says . . .


At the top of page 141 139 is the header and a comment about the newer parts:

let pins / pinsc =
For M2 and X2 parts see the next page.
On that next page (p 142 140) the example is:
Example:
let dirsB = %10000011 ; 7,0,1 as outputs
let pinsB = %10000011 ; switch outputs 7,0,1 on
pause 1000 ; wait 1 second
let pinsB = %00000000 ; switch all outputs off
If you are programming for an M2 or X2 part, don't forget the dirs<x> command.
Some commands such as HIGH and LOW automatically change the IO pin to an output. Other commands specifically require the use of the DIRS<x> comment where <x> is the port of interest.
 
Last edited:

Circuit

Senior Member
Westy, which version of PICAXE manuals are you using? The page references I gave are for the current version of the manuals; v.7.9.2 10/2015. The examples you show appear on pages 141 and 142 in the current version.
 

westaust55

Moderator
Westy, which version of PICAXE manuals are you using? The page references I gave are for the current version of the manuals; v.7.9.2 10/2015. The examples you show appear on pages 141 and 142 in the current version.
Same version (V7.9.2) using the link at the top of these forum pages (to http://www.picaxe.com/docs/picaxe_manual2.pdf) but when I went back to get the page numbers on the open pdf file, seems I went to the DIRS<x> instead of PINS<x> pages :mad:
 
Top