noobie to PICs and PBPro... Programming question.


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Location
    Indianapolis, IN USA
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    OK, I think I follow your points, but the suggestions are no along the lines I wanted to go. Let me restate the question this way...

    I have 8 I/O pins that are NOT in succession.

    I want to assign names to the pins. I want those names to be an array, so I can cycle through them in succession in a loop. By assigning the bits to the array name, I should be able to rearrange them logically to fit my physical setup.

    Is that achievable in PBPro, and if so, what do I need to do so?

    I attempted to do this by creating the array led[x]. I then defined each bit of led[x] to a specific I/O pin (porta.2 = led[1]) I have also tried this with led[1] var porta.2, and that did not work either. It does work if I do NOT use an array ( led1 var porta.2 ), but then I can't use the name led1 in a loop, cycling from led1 to led9...

    Is that question more clear?

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    mcphill,

    I understand your question and the link I provided is the key. In post 7 of that link I show how to, in a loop blink three port pins in succession - RB6, RC4, and RD2. The order and pin can easily be changed. Further, Ingvar, Bruce, Darrel, and others show other ways to do this. Study post 1 from that thread and make sure you understand what the OP requested. Then see post 7 and beyond for the answer. If you still need more explanation, I will have some time tonight to re-reply.

    Good Luck
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. PBPro for 16-bit PICs (24F/24H/DSPICs)?
    By Sergeant in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 20th April 2007, 20:18

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