
Template Software STM32F429 Discovery Kit with SCD41 CO2 Sensor
Dependencies: LCD_DISCO_F429ZI TS_DISCO_F429ZI BSP_DISCO_F429ZI
scd41.cpp@13:aff8e9f42652, 2022-03-22 (annotated)
- Committer:
- garj
- Date:
- Tue Mar 22 10:19:59 2022 +0000
- Revision:
- 13:aff8e9f42652
update to SCD41
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garj | 13:aff8e9f42652 | 1 | #include "mbed.h" |
garj | 13:aff8e9f42652 | 2 | #include "scd41.h" |
garj | 13:aff8e9f42652 | 3 | |
garj | 13:aff8e9f42652 | 4 | //----------------------------------------------------------------------------- |
garj | 13:aff8e9f42652 | 5 | // Constructor |
garj | 13:aff8e9f42652 | 6 | |
garj | 13:aff8e9f42652 | 7 | Scd41::Scd41(PinName sda, PinName scl, int i2cFrequency) : _i2c(sda, scl){ |
garj | 13:aff8e9f42652 | 8 | _i2c.frequency(i2cFrequency); |
garj | 13:aff8e9f42652 | 9 | _temp = 0; |
garj | 13:aff8e9f42652 | 10 | _humi = 0; |
garj | 13:aff8e9f42652 | 11 | _co2 = 0; |
garj | 13:aff8e9f42652 | 12 | } |
garj | 13:aff8e9f42652 | 13 | |
garj | 13:aff8e9f42652 | 14 | uint8_t Scd41::init(){ |
garj | 13:aff8e9f42652 | 15 | return SCD_ERROR_NO_ERROR; |
garj | 13:aff8e9f42652 | 16 | } |
garj | 13:aff8e9f42652 | 17 | |
garj | 13:aff8e9f42652 | 18 | bool Scd41::isMeasurementReady(){ |
garj | 13:aff8e9f42652 | 19 | return true; |
garj | 13:aff8e9f42652 | 20 | } |
garj | 13:aff8e9f42652 | 21 | |
garj | 13:aff8e9f42652 | 22 | uint8_t Scd41::readMeasurement(){ |
garj | 13:aff8e9f42652 | 23 | return SCD_ERROR_NO_ERROR; |
garj | 13:aff8e9f42652 | 24 | } |