GY-63_MS5611/libraries/SHT31_SW/SHT31_SW.h

45 lines
971 B
C
Raw Normal View History

2023-03-24 07:12:37 -04:00
#pragma once
//
// FILE: SHT31_SW.h
// AUTHOR: Rob Tillaart, Gunter Haug
2024-06-14 12:56:34 -04:00
// VERSION: 0.3.0
2023-03-24 07:12:37 -04:00
// DATE: 2019-02-08 (base SHT31 lib)
// PURPOSE: Arduino library for the SHT31 temperature and humidity sensor
// to be used with the SoftWire library instead of (hardware) Wire.
// derives from SHT31 0.3.8
2023-07-23 08:02:17 -04:00
// URL: https://www.adafruit.com/product/2857
// https://github.com/RobTillaart/SHT31_SW
// https://github.com/RobTillaart/SHT31
2023-03-24 07:12:37 -04:00
2024-06-14 12:56:34 -04:00
#define SHT31_SW_LIB_VERSION (F("0.3.0"))
2023-05-12 11:01:00 -04:00
2023-03-24 07:12:37 -04:00
#include "Arduino.h"
#include "SoftWire.h"
#include "SHT31.h"
class SHT31_SW : public SHT31
{
public:
2023-12-09 13:54:36 -05:00
SHT31_SW(uint8_t address, SoftWire *wire);
bool begin();
2023-03-24 07:12:37 -04:00
2023-07-23 08:02:17 -04:00
// check if sensor is reachable over I2C
2023-03-24 07:12:37 -04:00
bool isConnected();
private:
bool writeCmd(uint16_t cmd);
bool readBytes(uint8_t n, uint8_t *val);
2024-06-14 12:56:34 -04:00
2023-03-24 07:12:37 -04:00
SoftWire* _softWire;
2024-06-14 12:56:34 -04:00
char swTxBuffer[8]; // see #12
char swRxBuffer[8]; // see #12
2023-03-24 07:12:37 -04:00
};
// -- END OF FILE --