PORTA.PinNo = 1 ' problem


Closed Thread
Results 1 to 4 of 4
  1. #1
    frank small's Avatar
    frank small Guest

    Default PORTA.PinNo = 1 ' problem

    Hi,
    Can anyone tell me what is wrong with this and how to get round it?
    I am using VB to control the pins of a pic over a serial link and I am just testing at the moment
    by turning on and off paticular pins
    Test code is something like this

    DIM PinNo AS BYTE
    DIM PinState AS BIT

    PinState = True
    LET PinNo =5
    If PinState = 1 then
    PORTA.PinNo = 1 ' problem
    else
    PORTA.PinNo = 0 ' problem

    The compiler has a problem with
    PORTA.PinNo = 1 or PORTA.PinNo = 0
    though no problem with
    PORTA.5 = 1
    Any suggestions please
    Regards
    Frank

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


    Did you find this post helpful? Yes | No

    Default

    Portx.myvariable is not a valid PBP statement.

    Please do a search for...

    pin* AND addressing

    ...as this topic comes up regularly in various guises.

  3. #3
    frank small's Avatar
    frank small Guest


    Did you find this post helpful? Yes | No

    Default Thanks

    Many thanks ,Melanie
    Regards
    Frank

  4. #4
    frank small's Avatar
    frank small Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie
    Looked at all the info as you suggested and it made sense
    However I cannot get porta.0(x) = 1 to compile
    Here is an example of one of my attempts
    In other attempts I used [x] instead of (x) and in frustration
    I declared Porta.0as an array but of course that did not work

    'Configure
    DEVICE = 16F877
    XTAL = 20
    '.................................
    Dim x as byte
    x=1
    porta.0(x) = 1

    What am I doing wrong?
    Regards
    Frank

Similar Threads

  1. Variable in array
    By Gusse in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd February 2009, 19:46
  2. one line led light make image
    By bioul in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 12:19
  3. HSERIN doesn´t work
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th July 2007, 14:23
  4. 12F629 Strange interupt behavior
    By BGreen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th May 2007, 15:35
  5. Working with indivividual bytes of an array
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2007, 19:16

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