Isolate chars of 2 digit integer?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2007
    Posts
    67

    Default Isolate chars of 2 digit integer?

    It seems like there's a statment that splits the individual characters of an integer into two separate variables.

    For example:

    MyVar = 45

    Make_MyVarCharacter1 = 4
    Make_MyVarCharacter2 = 5

    I'm splitting numbers for display on a 2 digit LED display. I know I saw the command here on the forum or in the PBP manual - been digging and can't find it.

    Thanks!

  2. #2
    Join Date
    Aug 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Doh! Found it. Went right to it right after posting. Figures. For anyone else looking for this....


    4.17.7. DIG
    DIG returns the value of a decimal digit. Simply tell it the digit number (0
    - 4 with 0 being the rightmost digit) you would like the value of, and voila.
    B0 = 123 ‘ Set B0 to 123
    B1 = B0 DIG 1 ‘ Sets B1 to 2 (digit 1 of
    123)

Similar Threads

  1. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  2. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25
  5. 2 Line Chars on a 2 Line LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th November 2003, 00: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