Is there a way to combine several Serial.write's into one?
For example, in this DH and DL xbee snippet (I've left off the other parts of the frame)
Serial.write((byte)0x00);
Serial.write((byte)0x13);
Serial.write((byte)0xA2);
Serial.write((byte)0x00);
Serial.write((byte)0x40);
Serial.write((byte)0xB0);
Serial.write((byte)0x9D);
Serial.write((byte)0x78);
Serial.write(0xFF);
Serial.write(0xFE);
// this would be the checksum
long sum = 0x00 + 0x13 + 0xA2 + 0x00 + 0x40 + 0xB0 + 0x9D + 0x78 + 0xFF + 0xFE;
I've tried building the DH and DL part of the frame like this. But this doesn't work. (I'm just showing the DH and DL part of the frame)
Serial.write(0x0013A200);
Serial.write(0x40B09D78);
and then the checksum
long sum = 0x17 + 0x0013A200 + 0x40B09D78 + 0xFF + 0xFE;
My goal is to combine the high and low byte of the destination xbee into one line.
Can someone help