Timer - pause? ..?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

  2. #2
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Both includes a LCD wich make it harder to understand the code :/

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    xobx, Just declare a word size variable and then pass it as the variable to the pause statement, like this:

    time var word 'time in milliseconds

    HIGH PORTB.1
    PAUSE time
    LOW PORTB.1

    Dave Purola,
    N8NTA

  4. #4


    Did you find this post helpful? Yes | No

    Default forgive my phone formatting.

    maybe something like this? (§ indicates new line) §loop: §button portb.0,1,255,0,but1,0,loop §gettime: §pause 100 §thetime = thetime + 1 §button portb.0,1,255,0,but1,0,gettime §flash: §for blink = 1 to thetime §high portb.1 §pause 100 §next blink §low portb.1 §goto loop

  5. #5


    Did you find this post helpful? Yes | No

    Default thetime var word

    max number of pauses will be 65535. so with pause 100 max time will be 6553.5 seconds or just under 110 mins. for longer times use a longer pause, for better accuracy use a smaller pause. it would also need a line in gettime to make sure it doesn't overflow.
    Last edited by nomad; - 3rd December 2007 at 12:43. Reason: oops

  6. #6


    Did you find this post helpful? Yes | No

    Thumbs up now that I'm home

    This will be more readable:
    Code:
    loop: 
    button portb.0,1,255,0,but1,0,loop
    
    gettime: 
    pause 100 
    thetime = thetime + 1 
    button portb.0,1,255,0,but1,0,gettime
    
    flash: 
    for blink = 1 to thetime 
    high portb.1 
    pause 100 
    next blink 
    low portb.1 
    goto loop

  7. #7
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Ok but I doesnt understand this line :/

    button portb.0,1,255,0,but1,0,loop

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    PBP Pro manual, page 47.

    All parameters explained

    Ioannis

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Replies: 11
    Last Post: - 12th July 2008, 02:36
  4. Fade out LEDs question
    By Sam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd June 2008, 10:50
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 03:46

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