Library to interface the SCP1000 temperature and pressure sensor.
Dependents: SCP1000_Example ku-make_sensor ku-make_sensor201302 SCP1000_Example ... more
Revision 7:61d2e698d988, committed 2010-10-08
- Comitter:
- kadams6
- Date:
- Fri Oct 08 17:39:06 2010 +0000
- Parent:
- 6:70e36f2da425
- Child:
- 8:1049590388b6
- Commit message:
Changed in this revision
SCP1000.cpp | Show annotated file Show diff for this revision Revisions of this file |
SCP1000.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SCP1000.cpp Tue Oct 05 20:04:30 2010 +0000 +++ b/SCP1000.cpp Fri Oct 08 17:39:06 2010 +0000 @@ -1,5 +1,5 @@ /** \file - SCP1000 cpp file + SCP1000 source file */ #include "SCP1000.h" @@ -21,11 +21,6 @@ wait(0.5); } -///Reads the pressure -/** - Reads the pressure from the sensor - @return Pressure in pascals. -*/ unsigned long SCP1000::readPressure() { unsigned long pressure_msb = read_register(PRESSURE); pressure_msb &= 0x07;
--- a/SCP1000.h Tue Oct 05 20:04:30 2010 +0000 +++ b/SCP1000.h Fri Oct 08 17:39:06 2010 +0000 @@ -9,17 +9,30 @@ class SCP1000 { public: + /** + * Constructor. + * + * @param mosi SPI MOSI pin + * @param miso SPI MISO pin + * @param sclk SPI SCLK pin + * @param cs Chip select pin + */ SCP1000(PinName mosi, PinName miso, PinName sclk, PinName cs); ~SCP1000() { /* empty */ }; - ///Reads the pressure /** - Reads the pressure from the sensor - @return Pressure in pascals. - */ + * Read the pressure. + * + * @returns The pressure in pascals. + */ unsigned long readPressure(); + /** + * Read the temperature. + * + * @returns The temperature in Celsius. + */ float readTemperature();