PDA

View Full Version : Picbasic Newbie Problem



Stargazer3141
- 20th August 2007, 10:35
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?

Bruce
- 20th August 2007, 14:36
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?

Robson
- 21st August 2007, 09:10
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


TRISB = 0
B0 VAR BYTE

Loop:
FOR B0 = 0 TO 255
PORTB = B0
PAUSE 250
NEXT B0
GOTO Loop
END

Stargazer3141
- 21st August 2007, 16:39
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.

Bruce
- 21st August 2007, 17:40
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/support/upgrade.htm#pbp

If not, that's probably the error.