Dear all
am trying to receive string from the terminal "web server" which contains the code am supposed to transmit. the issue is that to be able to send the string has to be a long unsigned int.
while the transmitting command "ir.sendnec"requires number in the form of "0xab123whatever" not int. not anything else.
Do you mean that the webserver sends a long unsigned int and you need to convert that into a string which is the hexadecimal equivalent of that number?
You extract the hex digits from a number by successively dividing by 16 and keeping the remainder (if I recall correctly). These values will then need to converted to their ascii characters. For example Ascii " 0" has the decimal value 48 so you need to add 48 to each of the values 0 to 9 that you get from the divisions and you need to add 55 to each of the values 10 to 15 to skip over some of the ascii characters so that 10 becomes A, etc.
Robin2:
Do you mean that the webserver sends a long unsigned int and you need to convert that into a string which is the hexadecimal equivalent of that number?
You extract the hex digits from a number by successively dividing by 16 and keeping the remainder (if I recall correctly). These values will then need to converted to their ascii characters. For example Ascii " 0" has the decimal value 48 so you need to add 48 to each of the values 0 to 9 that you get from the divisions and you need to add 55 to each of the values 10 to 15 to skip over some of the ascii characters so that 10 becomes A, etc.
...R
thanks for your fast reply. but my issue is quite the opposite. i have the hex digits and want to convert it to long unsigned int.
can u help with that?