#define makeLong(hi, low) (((long) hi)<<16 | (low))
#define highWord(w) ((w)>>16)
#define lowWord(w) ((w) & 0xffff)
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
int longValue = 0x1020304;
//int aWord;
int loWord, hiWord;
loWord = lowWord(longValue);
hiWord = highWord(longValue);
Serial.println(longValue, DEC);
Serial.println(longValue, BIN);
Serial.println(loWord, DEC);
Serial.println(hiWord, DEC);
Serial.print(hiWord, BIN);
Serial.print("\t");
Serial.println(loWord, BIN);
longValue = makeLong(hiWord, loWord);
Serial.println(longValue, DEC);
delay(100000);
}