Button command


Closed Thread
Results 1 to 2 of 2

Thread: Button command

  1. #1
    Join Date
    Dec 2008
    Posts
    23

    Default Button command

    Does anyone use the Button command from the book to get an input from a pin(on/off switch)?

    Is there another way to do it ?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MrRoboto View Post
    Does anyone use the Button command from the book to get an input from a pin(on/off switch)?

    Is there another way to do it ?
    I suppose some people use it, 2 if then loops are easier to get to work though.
    Code:
    main:
    If PortA.1 = 1 THEN
    pauseus 500
    If PortA.1 = 1 THEN
    PortB.1 = 1
    else
     PortB.1 = 0
    endif
    endif
    goto main
    The pauseus gives time to debounce switch and checks again, if true then execute.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Button command explanations
    By F1CHF in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th October 2006, 15:34
  3. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Serin2 and Button command
    By ero in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 1st March 2005, 08:46

Members who have read this thread : 1

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