Hex values to decimal


Results 1 to 14 of 14

Threaded View

  1. #13
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Hex values to decimal

    And what's stopping you?
    Either I don't get it or you don't :-) No offense.

    Code:
    mai VAR BYTE
    value VAR BYTE
    
    mai = $2B   'assign value to variable, in this case the value 43 represented as HEX.
    
    mai = mai + 10
    LCDOUT $FE, 1, DEC mai   ' will show 53
    PAUSE 2000
    
    value = mai * 4
    LCDOUT $FE, 1, DEC value   ' will show 212
    PAUSE 2000
    
    value = value / 5
    LCDOUT $FE, 1, DEC value    ' will show 42
    PAUSE 2000
    
    IF mai < $3A THEN
      LCDOUT $FE, 1, "mai is smaller than 58"
    ENDIF
    PAUSE 2000
    
    IF mai > value THEN
      LCDOUT $FE, 1, "Yes, mai is bigger than value"
    ENDIF
    PAUSE 2000
    
    LCDOUT $FE, 1, DEC mai, "  ", HEX mai
    PAUSE 2000
    Show us the math or comparison you're wanting to do and tell us wha the problem you're having actually is.

    /Henrik.
    Last edited by HenrikOlsson; - 3rd January 2017 at 19:53.

Similar Threads

  1. Hex to Decimal to Binary
    By Ramius in forum FAQ - Frequently Asked Questions
    Replies: 3
    Last Post: - 28th March 2014, 01:01
  2. Decimal PWM Cycle values?
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2012, 12:58
  3. Hex to Ascii to Decimal
    By khoog in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st July 2009, 05:27
  4. Convert Hex to Decimal
    By RONKON in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 9th May 2006, 01:01
  5. Decimal values from string
    By GioppY in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th November 2005, 21:10

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