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

44 lines
989 B
C
Raw Normal View History

2023-07-20 10:06:31 -04:00
#pragma once
//
// FILE: SHT31_SWW.h
// AUTHOR: Rob Tillaart, Gunter Haug
// VERSION: 0.1.0
// DATE: 2019-02-08 (base SHT31 lib)
// PURPOSE: Arduino library for the SHT31 temperature and humidity sensor
// to be used with the SoftwareWire library instead of (hardware) Wire.
// derives from SHT31 0.3.8
// https://www.adafruit.com/product/2857
// URL: https://github.com/RobTillaart/SHT31_SWW
// URL: https://github.com/RobTillaart/SHT31
#include "Arduino.h"
#include "SoftwareWire.h"
#include "SHT31.h"
#define SHT31_SWW_LIB_VERSION (F("0.1.0"))
class SHT31_SWW : public SHT31
{
public:
SHT31_SWW();
// use SHT_DEFAULT_ADDRESS
bool begin(const uint8_t address, SoftwareWire *wire);
bool begin(SoftwareWire *wire);
// check sensor is reachable over I2C
bool isConnected();
private:
bool writeCmd(uint16_t cmd);
bool readBytes(uint8_t n, uint8_t *val);
SoftwareWire* _softWire;
};
// -- END OF FILE --