I’ve been looking into serial communication between multiple arduinos and have learned many things about the necessary hardware and wiring needed. Having given up on using a twi system ( viewtopic.php?f=8&t=20585 ) I plan on running a separate cable (CAT5?) from arduino to arduino. My current problem is in trying to learn the serial.read() code.
I’ve got the switch case ( I think) part down. I want to run a string with a header (0x00) , 4 pairs of ASCII data (00-99), and an end (ETX, 0x04?) with checksum (2 bytes, right?). 12 parts, yes?
So I tell serial.read() to read until the byte == my header. Then how do I parse the remaining bytes in order? Or assign them to a variable so I can make my code deal with the data? All of the examples use real-time streaming from Tx to display and say nothing of interpretting, say, the middle data block in some way.
I’ve seen reference to /n, <<, &&, |…are these things to increment byte to byte? Is byte the right term for each parcel I’m trying to parse out of my string?
Ending up feeling stoopit, since I can’t seem to get a handle…