Single button function


Closed Thread
Results 1 to 40 of 41

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen
    Your example had the same issue. User sees no change in the display until the button is released.

    I will look into placing the while:wend after display update.
    Other than my goof with the WHILE / WEND, the code will jump to a new menu after a HOLD of ~ 1 second. If only pressed, the button test loop ends immediately, and the code continues as needed after a press & release.

    The button test loop auto-terminates after 2 seconds, so even if the user continues holding the button, the code will jump to the new menu anyway, and only after writing the new menu, does it then wait for a button release.

    Arch
    "Data sheets? I ain't got no data sheets. I don't need no data sheets. I don't have to read any stinking data sheets!"

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Melanie I've added your code into my project. When setting the times hours, minutes, or seconds the display clears and only displays the value that is currently being altered. Are you seeing the same thing or am I missing something?

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


    Did you find this post helpful? Yes | No

    Default

    You're doing something wrong...

    When setting the Time, you can see all the fields (by field, you can see Hours, Minutes and Seconds on the same line, and as you press momentarilly, only the field you are currently parked on will change. When you hold for SET, the cursor changes from an underscore to a Block and on finger release moves to the next field, leaving the previous one with the content you set.

    I refer you to the Button-02 picture... there you can see the underscore cursor parked in the Hours field... pressing momentarily will advance Hours through to 23 then cycle around starting from zero. Hold the Button for SET and the cursor changes to a BLOCK, and on finger release moves to Minutes changing back to an Underscore.

    Check your $FE,xx's are the same as mine...

    Melanie

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Duh! <smacks forehead> my switch routine had a LCD clear command in it.

  5. #5
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Default syntacks(",)

    Good day

    I'm a picbasic newbie i'd like to ask these syntaxes do?

    AMPMFlag=AMPMFlag^1 '>>>>>>>>>>>>>>>>>>>what does this do?

    Lc var byte [15]
    For i = 0 to 15 : read i, b0:if b0 = 0 then
    lookup i,[1,2,3,11,4,5,6,11,7,8,9,10,11,12,13,14], b0
    Lc(i)=b0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>what does this do?
    goto Address

    I would gladly appreciate for any response
    thanks
    ryan

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


    Did you find this post helpful? Yes | No

    Default

    AMPMFlag=AMPMFlag^1 '>>>>>>>>>>>>>>>>>>>what does this do?

    AMPMFlag is a BIT variable.
    All this does is toggle the BIT variable, if it was zero it will be set to 1, if it was 1 it will be set to 0. It is the equivallent of...

    IF AMPMFlag=0 then
    AMPMFlag=1
    else
    AMPMFlag=0
    endif



    Lc var byte [15]
    For i = 0 to 15 : read i, b0:if b0 = 0 then
    lookup i,[1,2,3,11,4,5,6,11,7,8,9,10,11,12,13,14], b0
    Lc(i)=b0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>what does this do?

    Lc is a BYTE array 15 elements deep in the range Lc(0) to Lc(14)
    You are loading Lc at array location i with the contents of variable b0

  7. #7
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Default thanks so much

    Thank you Mel,
    I am incorporating your olympic timer in my medicine scheduler project I used some code snippets from les Johnson's book "experimenting with picbasic" I also read your thread with bits,byte, and arrray handling and found it intuitive!!!
    I am still fixing my keypad routine to scan and output to LCD like a mobile fone does(",) I am trying to find a lcd menu routine for my display I will post it later on a new thread

    thanks again
    ryan

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Pushbutton code routine suggestions?
    By jessey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd September 2005, 01:02
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 16:44

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