Hi...
If you want something to manage ascii data, the function sugested by Kent could be what you need.
Anyway i don't understand what you mean... as 27 is the same than 1B, if you send 27 you are sending 0x1B or 00011011 there are just different ways of representing the same value.
if you want send 0x01 and then 0x0B you can do:
variable = 27
first_value = variable and 0x0F
second_value = variable and 0xF0
i need to send it out as hex from the pic, they are control commands for a camera that is looking for hex to be sent to it, like "1F" "0A" etc., so what you are saying is if i tell it to send "27" or "1B" the output is the same thing?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i need to make a new number from 2 numbers, ex. A and B become "AB" not A+B how do i do this?
You need to create a word variable in order to have a 16 bit value, then you can do this way
__________________________________
dim variableA as byte
dim variableB as byte
dim combinedAB as word
combinedAB = B
combinedAB_H = A
__________________________________
Note that variableA is in high byte, just like this: variableAvariableB
will this work for alpha numeric combinations? like hex numbers ex. "3F"
Do you want to "combine" two bytes or two nibbles... can you give a concrete example???
i am having the pic convert decimal numbers into 2 digit hex and send them out serially.
ex. 27 into "1" "B" and I want to send "1B" out my serial pin
There is a sub LCDHex(In LCDValue) in the lcd.h file. Sounds like what you need.
Hi...
If you want something to manage ascii data, the function sugested by Kent could be what you need.
Anyway i don't understand what you mean... as 27 is the same than 1B, if you send 27 you are sending 0x1B or 00011011 there are just different ways of representing the same value.
if you want send 0x01 and then 0x0B you can do:
variable = 27
first_value = variable and 0x0F
second_value = variable and 0xF0
'Now you have:
first_value = 0x0B = 11 = b'00001011'
second_value = 0x01 = 1 = b'00000001'
i am having the pic convert decimal numbers into 2 digit hex and send them out serially.
ex. 27 into "1" "B" and I want to send "1B" out my serial pin
i need to send it out as hex from the pic, they are control commands for a camera that is looking for hex to be sent to it, like "1F" "0A" etc., so what you are saying is if i tell it to send "27" or "1B" the output is the same thing?
Yes "27" and "1B" is the same thing
you can send hex values this format: 0x1B
or you can send: 27
The received data will be the same in both cases.