Take look at the sensor decoding example, line 60 ;-)