Single button function


Closed Thread
Results 1 to 40 of 41

Hybrid View

  1. #1
    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

  2. #2
    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.

  3. #3
    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

  4. #4
    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

  5. #5
    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

  6. #6


    Did you find this post helpful? Yes | No

    Default

    here is a chip that will give you 2 button's on one i/o
    http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4588

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


    Did you find this post helpful? Yes | No

    Default

    You seriously want to pay $1 for a 2 I/O expander?

    If you need two buttons on one I/O, then you can achieve that with a different value of Capacitor on each of two Buttons and measure the time period for charge. Cost about 5 cents and a bit of magic in software...

Similar Threads

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

Members who have read this thread : 2

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