Sorry, that comment should have been removed from the example code after i modified it.
Yes, that is the idea. However, when the code is run, it prints out the following
100111
10000
10000
16
so below is what the code says, what it output, and what i expected;
10000 == 0010011100010000
Serial.println(High, BIN); // OUTPUT - 100111 // expected the first 8 digits of 0010011100010000
Serial.println(Low, BIN); // OUTPUT - 100000 // expected the last 8 digits of 0010011100010000
Serial.println(data_rec, BIN); // OUTPUT - 10000 // expected 0010011100010000
Serial.println(data_rec); // OUTPUT - 16 // expected 10000
So there was an error in the line
int data_rec = word(High<<&8, Low);
which i have now changed to
int data_rec = (High<<8| Low);
and the final output works and gives the correct final integer. However, even then it is ommitting leading zeros with
Serial.println(data_rec, BIN); // OUTPUT - 10011100010000// expected 0010011100010000
so why are leading zeros ommitted and in future how can i stop this?
Thanks