Hex Value


Closed Thread
Results 1 to 3 of 3

Thread: Hex Value

  1. #1
    Join Date
    Jun 2007
    Posts
    7

    Default Hex Value

    Hi All

    It has been a while since I have worked with Proton and I am still learning
    I have got a problem whre I want to send a Hex value
    Say I have got a value of 85 , I then want to send Hex 85("$85") not 55 witch is the Hex of 85
    I have tried some codes , but no luck

    Dim Val1 as Byte
    Dim Val2 as Byte

    Main:
    Val1 = 85
    delayms 100
    serout port,baud,[Val1]
    'Got out 55

    serout port,baud,[# Val1]
    'Got out 38 35 must just be the 85

    Val2 = $Val1
    serout port,baud,[Val2]
    'Got out 00 but if you put in Val2 = $85 I get out 85 is Val2 = $Val1 not the same as
    Val2 = $85 ?

    Any help
    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Wish I could help you but...here we do Pic Basic. Might try another forum.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Perhaps the HEX modifier instead of # would solve your problem?

    Val1=$85
    SEROUT ...[HEX2 Val1]

    Pds forum....
    www.picbasic.org/forum
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Configuration bits in a HEX file gone missing?
    By grzes.r in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd February 2010, 01:10
  3. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  4. Reading from External Hex Address...
    By sbouda in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th October 2008, 06:33
  5. INH8XM HEX file structure
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th December 2006, 22:46

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