looping / counter


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Posts
    18

    Default looping / counter

    hi,

    need help in puting a counter to my sub routine.
    im using 16f84a.

    example:
    the programm will excercute the selected subroutine for maybe 10times count continuesly,
    if the condition true then it will proceed to the next command..

    here are my example of one of the subroutine.
    reasons of using counter to this subroutine so that my programm can be shorten.

    A:
    TRISB=0
    portb=%00000101
    pause 50
    portb=%11000111
    pause 20
    return

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Tech,

    Look in the PBP manual and check out the WHILE statement and try experimenting. You can stay within a loop using this statement until your switch returns to where you want it. Also read through these forums and I know you will find plenty of examples.

    BobK

  3. #3
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Tech,

    I went back and looked at my library of posts here and found one titled "Timing the pressing and releasing of a pushbutton" that was posted in March of 2006. Melanie posted a code example that should work for what you want to do.

    Do a search for this article.

    HTH,

    BobK

  4. #4
    Join Date
    Apr 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    thanks..
    problem solve..
    i used while and wend

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Counter not counting !!!
    By lerameur in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 20th February 2009, 22:15
  3. Replies: 42
    Last Post: - 14th January 2008, 11:38
  4. 20 Digit Virtual LED Counter
    By T.Jackson in forum Code Examples
    Replies: 9
    Last Post: - 19th November 2007, 05:02
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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