Seite 1 von 1

Help with Strings and hex

Verfasst: Mittwoch 28. August 2024, 16:53
von QMESAR
HI all
Please can you help me
ConversionExample.prj
(2.85 KiB) 260-mal heruntergeladen
I am truing to convert a dec number(0-255) into a Hex number that must be send with Serial
to an Controller as in the example attached convert 180dec to hex which is B4 however when I send it to the serial I get 1 byte for B and 1 byte for 4
thus instead of sending the oxB4 as one byte I have 2 bytes 0x0B and 0x04 .

What am I doing wrong please help me out
any help hints is appreciated
Regards

Re: Help with Strings and hex

Verfasst: Donnerstag 29. August 2024, 09:35
von funkybaer
Is this what you need ?

hex.jpg
hex.jpg (74.71 KiB) 3094 mal betrachtet

Re: Help with Strings and hex

Verfasst: Freitag 30. August 2024, 16:12
von QMESAR
Dear funkybaer

Thank you very much for your help this seems it will work,or is correct,I will give it a go next week when at work again. :D
much appreciated

Regards