![]() ![]() ![]() First it reads the highest three bits, then the lower 16 bits. Once it's got the temperature, it reads the pressure in two parts. ![]() Then it reads the temperature's two bytes. The actual reading in degrees Celsius is the 16-bit result divided by 20. In the main loop, it sets the sensor to read in high resolution mode, meaning that it will return a 19-bit value, for the pressure reading, and 16 bits for the temperature. The code below starts out by setting the SCP1000's configuration registers in the setup ( ). For details of the control registers, see the SCP1000 data sheet. The SCP1000 barometric pressure sensor can read both air presure and temperature and report them via the SPI connection. This example shows how to use the SPI (Serial Peripheral Interface) Communications Library to read data from a SCP1000 Barometric Pressure sensor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |