Picbasic Newbie Problem


Closed Thread
Results 1 to 5 of 5
  1. #1

    Default 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?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    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
    Last edited by Robson; - 21st August 2007 at 10:11.

  4. #4


    Did you find this post helpful? Yes | No

    Default 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.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  2. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  3. Problem on writing EEPROM in Winpic800 with picbasic pro
    By selimkara in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th May 2007, 16:33
  4. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 04:36
  5. DMX & PicBasic coding problem
    By magicmarty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th September 2004, 15:35

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts