So this code
#include <Arduino.h>
void setup()
{ Serial.begin(9600);
int i=1 ;
int j=-1 ;
Serial.println(i);
Serial.println(j);
Serial.println(i,HEX);
Serial.println(j,HEX);
}
void loop()
{
}
Prints this
1
-1
1
FFFFFFFF
Now if the int is 16 bits, should be four hex digits. So why do I get 8 hex digits ?
If I change "i" to some positive number like 512, I get 200 hex.