for a start your temp var is a declared as byte , how can 12 bit reading fit in that ?