Displaying numbers


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply. I never thought of doing tach = (b1*100)+(b2*10)+b3 and this will work perfect! The problem is that the numbers are coming over a wireless link and I am having trouble sending word variables. I know these are byte variables but it is only an example. Anyhow, the variables are not going to an LCD display. This is a great temporary solution until I can find out how to send word variables over a wireless link.

    Thanks!

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


    Did you find this post helpful? Yes | No

    Default

    Be sure not to overflow your variable type with the calculation
    tach = (b1*100)+(b2*10)+b3

    Arch

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


    Did you find this post helpful? Yes | No

    Default

    Arch... it would not be possible to overflow a word with that formula...

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie
    Arch... it would not be possible to overflow a word with that formula...
    Guess I should have been more specific about that - I meant if he was using a byte variable. (but now I see that he mentioned a word-sized variable - DUH!)

    Arch

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


    Did you find this post helpful? Yes | No

    Default

    "This is a great temporary solution until I can find out how to send word variables over a wireless link."

    If you can send bytes then you can send words.

    When you send just break the words into bytes.

    tach var word

    tach.lowbyte = high byte of word
    tach.highbyte = low byte of word

Similar Threads

  1. Joining variables and displaying on an LCD
    By Navaidstech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th April 2009, 04:12
  2. Replies: 4
    Last Post: - 15th April 2009, 01:54
  3. Working with 3 byte numbers
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th July 2007, 22:59
  4. Splitting numbers and recombining them(EEPROM Error)
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd June 2007, 06:40
  5. Returning whole numbers for DS1820?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th February 2007, 12:15

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