I know I'm missing something so simple here, but I can't figure it out.
If I do char letter = 'A'; then letter = letter << 8, letter = 0, as one should expect, since we are shifting the bits "off the shelf" to the left.
But, if we do this:
char letter = 'A';
void setup()
{
Serial.begin(9600);
int twoBytes = letter << 8;
Serial.println(twoBytes, BIN);
}
void loop() {}
The result is 100000100000000, but why? << has precedence over =, so it should be bitshifting letter left by 8 first, then assigning that value (which should be 0) to twoBytes.