checksum function for sending serial bytes
CRST1
Posts: 103
in Propeller 1
Hi all. Been away from propeller for a while and a little rusty now.
What I'm needing to do is send a byte stream to a 4D display. This will be 6 bytes. Five data and one checksum. Id like to make a function that accepts the 5 bytes and makes a checksum and then sends the 6 bytes out serial. What would be the best way to go about this? The checksum is just the 5 byte xor'd together.
I think I would start another PUB and then call it from the main with 5 parameters?
Any quick examples to start with would be appreciated.
Thanks
What I'm needing to do is send a byte stream to a 4D display. This will be 6 bytes. Five data and one checksum. Id like to make a function that accepts the 5 bytes and makes a checksum and then sends the 6 bytes out serial. What would be the best way to go about this? The checksum is just the 5 byte xor'd together.
I think I would start another PUB and then call it from the main with 5 parameters?
Any quick examples to start with would be appreciated.
Thanks
Comments
I saw someone said use tx.str(string($80, 2, 2)) aslong as not sending 0
I will need to send 0.
For the checksum, you could roll it into the transmit routine.
no, bite is already the char, byte[stringptr++], so the second invoke of byte[..] is not needed.
nothing to do with local or global.
Enjoy!
Mike