-
Picbasic Newbie Problem
I am using picbasic from MElabs and cannot get this code to compile:
Symbol TRISB = 134
Symbol PortB = 6
poke Trisb , 0
loop:
For B0=0 to 255
poke PortB , B0
Pause 250
Next B0
Goto loop
end
The code is out of the book by John Iovine
When I try to compile I get an error message on the "poke Trisb, 0 " command that says
ERROR LINE 13 ":" or "=" expected (Token 'Trisb') (count.bas)
Does anyone know why?
-
What version of PBC are you using? It compiles fine with v1.45.
Can you compile any of the examples in the SAMPLES folder that
poke values to TRIS registers?
-
Hello Stargazer
what should this code do?
Are you looking for how to display the outputs from PORTB connected with LEDīs?
My compiler returns an error too.
Maybe this one will help you
Code:
TRISB = 0
B0 VAR BYTE
Loop:
FOR B0 = 0 TO 255
PORTB = B0
PAUSE 250
NEXT B0
GOTO Loop
END
-
thanks for the help
Thanks!
I am just trying to troubleshoot my compiler - picbasic ver1.41.
I noted from the ME labs website that the PEEK and POKE were added on version 1.20, so they should be working on my version. I do not see any syntax error or typos.
-
Version 1.41 is fairly old. Look at this page to see if the PIC you're compiling for is supported
by version 1.41: http://www.microengineeringlabs.com/...pgrade.htm#pbp
If not, that's probably the error.