Port pin variables


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Location
    Warrenton Mo
    Posts
    7

    Default Port pin variables

    Why does this not work in PicBasic Pro?? I'm using a Pic16f870

    for j=0 to 7
    portb.j=1
    pause 100
    portb.j=0
    next j

    also,
    high portb.j
    does not work

    I get a "Bad Variable Modifier" error at each portb program line

    thanks

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Dec 2009
    Location
    Warrenton Mo
    Posts
    7


    Did you find this post helpful? Yes | No

    Default port variables

    this will compile ok....portb[x] and portb(x) compiles ok too, but it does nothing to activate the port.
    So I guess the question is, how do you use a variable on a port?

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    So I guess the question is, how do you use a variable on a port?
    Try this way, it will compile and work as well.

    for j=0 to 7
    portb0.[j]=1
    pause 100
    portb0.[j]=0
    next j

    Cheers

    Al.
    All progress began with an idea

Members who have read this thread : 0

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