- Feb 17, 2006
- 61
- 0
- 0
Hey guys,
I am trying to send data to a kestrel autopilot using an ATmega16. Basically, you feed the autopilot serial data written in arbitrary packets that are well-documented. However, there is a checksum value (of type INT) that needs to be sent (as 2 CHARs) in everyone of these packets. My question is how to break an INT into 2 separate CHARs.
For example... say I want to send an INT of value 1451 but needs to be of type CHAR. The hex value of 1451 is 0x05AB. This can be split to 8bit CHAR hex values 0x05 and 0xAB. Yes? Then I could send each of these individually.
I hope this makes sense, and thank you for your help in advance,
I am trying to send data to a kestrel autopilot using an ATmega16. Basically, you feed the autopilot serial data written in arbitrary packets that are well-documented. However, there is a checksum value (of type INT) that needs to be sent (as 2 CHARs) in everyone of these packets. My question is how to break an INT into 2 separate CHARs.
For example... say I want to send an INT of value 1451 but needs to be of type CHAR. The hex value of 1451 is 0x05AB. This can be split to 8bit CHAR hex values 0x05 and 0xAB. Yes? Then I could send each of these individually.
I hope this makes sense, and thank you for your help in advance,