Need Help To Understand This Program


Closed Thread
Results 1 to 3 of 3

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hi Danish,

    Just wondering if you're covered with Cream Cheese. Mmmmmmm.

    The BUTTON command will never time out because B0 is getting reset to 0 on every loop. It will never reach a full count. Try putting the B0 = 0 outside the loop, something like this.
    Code:
    B0=0 
    loop:
        BUTTON 1,1,254,0,B0,1,ButttonPressed
        TOGGLE 0
        PAUSE 500
    GOTO LOOP
    
    ButttonPressed:
    ' ... code here ...
    goto loop
    ADDED: I should probably mention that the PAUSE 500 with a BUTTON delay of 254 will mean you'll have to hold the button down for 128 seconds before it will jump to the Button pressed routine. So a smaller delay or pause will be needed.<br>
    Last edited by Darrel Taylor; - 9th August 2005 at 22:28.
    DT

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

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