union
{
unsigned long ulong;
byte bytes[4];
} uLongBytes;
//stuff sendThis;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//stuff sendThis;
unsigned long value = 12345678;
uLongBytes.ulong = value;
Serial.print("bytes:");
Serial.print(uLongBytes.bytes[0]);
Serial.print(uLongBytes.bytes[1]);
Serial.print(uLongBytes.bytes[2]);
Serial.println(uLongBytes.bytes[3]);
byte arr[4];
arr[0] = value & 0xFF;
arr[1] = (value >> 8) & 0xFF;
arr[2] = (value >> 16) & 0xFF;
arr[3] = (value >> 24) & 0xFF;
Serial.print("bytes:");
Serial.print(arr[0]);
Serial.print(arr[1]);
Serial.print(arr[2]);
Serial.println(arr[3]);
}
void loop() {
// put your main code here, to run repeatedly:unsigned long valye = 0x12345678;
}