convert the numbers to word


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile My guess

    Hi savnik,

    See if I read you correctly.
    You want the user to be able to press a series of buttons, on your keypad. You would like the PIC to take this series of separate button values and “string them together” (“concatenate” them). Then use them as a PIC WORD variable in your program.

    You are able to read the individual button presses, but are having trouble putting them together to make the variable.

    Is that close?

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    Hi savnik,
    You want the user to be able to press a series of buttons, on your keypad. You would like the PIC to take this series of separate button values and “string them together” (“concatenate” them). Then use them as a PIC WORD variable in your program.
    You are able to read the individual button presses, but are having trouble putting them together to make the variable.
    Is that close?
    -Adam-
    Ok, well that makes a bit more sense to me...

    getword:
    for x = 0 to 3
    Gosub getkey ' Get a key from the keypad
    keyin(x) = key 'save the individual keypresses
    lcdout I,Line2 + x,#key ' Display ASCII key number
    next
    outval = ( keyin(0) * 1000 ) + ( keyin(1) * 100 ) + ( keyin(2) * 10 ) + keyin(3)
    return

  3. #3
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    Hi savnik,

    See if I read you correctly.
    You want the user to be able to press a series of buttons, on your keypad. You would like the PIC to take this series of separate button values and “string them together” (“concatenate” them). Then use them as a PIC WORD variable in your program.

    You are able to read the individual button presses, but are having trouble putting them together to make the variable.

    Is that close?

    -Adam-
    yes , i want it

Similar Threads

  1. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

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