Newbee pause from var word


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    35

    Default Newbee pause from var word

    In my code there is ten or so pause's that need to be changed from time to time. How do I have the pause command look at a fixed value so that I only have to change it, instead of ten lines of code? What am I missing?

    I might have figured it out, after an hour of searching, sometimes it just don't soak in

    T1 var word
    PAUSE T1
    T1=600

    Thanks to the greatest forum ever! Emmett
    Last edited by emmett brown; - 6th August 2006 at 23:50.

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


    Did you find this post helpful? Yes | No

    Default

    You've got it... except in your example you should set T1 to have a value BEFORE your first usage of PAUSE.

    Here's an example that will vary the length of time an LED will stay ON...

    MyDelay var WORD
    LED var PortB.0
    TRISB=0

    Loop:
    For MyDelay=1000 to 10000 step 1000
    High LED
    Pause MyDelay
    Low LED
    Pause 1000
    Next MyDelay
    Goto Loop

  3. #3
    Join Date
    Jun 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Default

    Ah Makes sense I love PBP and this forum! Priceless! Thanks much Melanie!

Similar Threads

  1. RF Modules
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 44
    Last Post: - 26th June 2010, 17:42
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  4. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23
  5. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47

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