syntax advice


Closed Thread
Results 1 to 2 of 2

Thread: syntax advice

Hybrid View

  1. #1
    ilteris's Avatar
    ilteris Guest

    Default syntax advice

    I am just wondering how I can do couple of things on picbasic pro. Please follow the comments below.

    TRISB = 1
    TRISC = 0
    i var byte ' generic i var to count
    leds var byte[8] 'declaration of array

    i = 0
    while i < 8
    leds[i] var portc.i
    ' I am just trying to set the array elements reference output pins
    ' like if I call leds[2] for example it should spit out portb.2
    ' is this possible in pic basic pro within a for loop?
    i = i + 1
    wend

    main:
    while i < 8
    'here I am trying to make them go high
    'am I on the right track?
    high leds[i]
    i = i + 1
    pause 1000
    wend

    ' should I just use i var in here as well, or should I declare another variable?
    while i < 8
    low leds[i]
    pause 1000
    i = i + 1
    wend


    goto main










    thanks for your suggestions.
    iltertis

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi iltertis,

    Melanie's done a couple of post's that should help you out.

    Bits, Bytes Words and Arrays
    http://www.picbasic.co.uk/forum/showthread.php?t=544

    pins in arrays?
    http://www.picbasic.co.uk/forum/showthread.php?t=1517
    <br>
    DT

Similar Threads

  1. Endless supply of 'syntax error's.
    By BitHead in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th December 2009, 20:21
  2. Need "PIC16F84A" Controler schematic Advice...
    By Kyo_89 in forum Schematics
    Replies: 1
    Last Post: - 27th May 2009, 23:03
  3. Replies: 0
    Last Post: - 1st September 2008, 07:03
  4. Your OTP advice?
    By truvahorse in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th June 2008, 16:37
  5. Advice needed on 'neat' Project!
    By vacpress in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th February 2007, 06:21

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