The maximum 10 bit value is 1023, not 1024