I have a function getID()
that returns a byte from the EEPROM:
byte getID(){
return (byte)EEPROM.read(0x0199);
}
Later, (on line 65), I use this function and Bitwise-OR it with a binary value:
byte out[3] = {getID()|B10000000, B00000001, B00000001};
Serial.write(out,3);
and it returns a `narrowing conversion from 'int' to 'byte':
file.ino:65:33: warning: narrowing conversion of '(int)(((unsigned char)((int)getID())) | 128)' from 'int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
byte out[3] = {(getID())|B10000000, B00000001, B00000001};
It is just a warning and the code works fine (I think), but why is this a narrowing conversion? I've tried making sure just about everything is a byte...