mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.0 LTC2991
This commit is contained in:
parent
85d5a6d6af
commit
0e2e14af7b
@ -6,19 +6,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.0] - 2023-12-04
|
||||
- refactor API, remove ESP32 specific code
|
||||
- update readme.md
|
||||
|
||||
----
|
||||
|
||||
## [0.1.6] - 2023-09-23
|
||||
- add Wire1 support for ESP32
|
||||
- update readme.md
|
||||
- add defines for readability
|
||||
|
||||
|
||||
## [0.1.5] - 2023-03-06
|
||||
- fix examples default address to 0x48
|
||||
- add getAddress() function
|
||||
- update keywords.txt
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.1.4] - 2023-01-22
|
||||
- update GitHub actions
|
||||
- update license 2023
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: LTC2991.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.6
|
||||
// VERSION: 0.2.0
|
||||
// DATE: 2021-05-10
|
||||
// PURPOSE: Library for LTC2991 temperature and voltage control IC
|
||||
// URL: https://github.com/RobTillaart/LTC2991
|
||||
@ -62,26 +62,15 @@ const float DIODE_VOLTAGE_FACTOR = 2.5 / 65536; // 2^16
|
||||
//
|
||||
// CONSTRUCTORS
|
||||
//
|
||||
LTC2991::LTC2991(const int8_t address, TwoWire *wire)
|
||||
LTC2991::LTC2991(const uint8_t address, TwoWire *wire)
|
||||
{
|
||||
_address = address;
|
||||
_wire = wire;
|
||||
}
|
||||
|
||||
|
||||
#if defined (ESP8266) || defined(ESP32)
|
||||
bool LTC2991::begin(const uint8_t sda, const uint8_t scl)
|
||||
{
|
||||
_wire->begin(sda, scl);
|
||||
if (! isConnected()) return false;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool LTC2991::begin()
|
||||
{
|
||||
_wire->begin();
|
||||
if (! isConnected()) return false;
|
||||
return true;
|
||||
}
|
||||
@ -363,8 +352,6 @@ float LTC2991::get_value(uint8_t channel)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PWM functions
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: LTC2991.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.6
|
||||
// VERSION: 0.2.0
|
||||
// DATE: 2021-05-10
|
||||
// PURPOSE: Library for LTC2991 temperature and voltage control IC
|
||||
// URL: https://github.com/RobTillaart/LTC2991
|
||||
@ -12,7 +12,7 @@
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define LTC2991_LIB_VERSION (F("0.1.6"))
|
||||
#define LTC2991_LIB_VERSION (F("0.2.0"))
|
||||
|
||||
//
|
||||
// DEFINES for readability
|
||||
@ -54,13 +54,9 @@
|
||||
class LTC2991
|
||||
{
|
||||
public:
|
||||
explicit LTC2991(const int8_t address, TwoWire *wire = &Wire);
|
||||
explicit LTC2991(const uint8_t address, TwoWire *wire = &Wire);
|
||||
|
||||
#if defined (ESP8266) || defined(ESP32)
|
||||
bool begin(const uint8_t sda, const uint8_t scl);
|
||||
#endif
|
||||
|
||||
bool begin();
|
||||
bool begin();
|
||||
bool isConnected();
|
||||
uint8_t getAddress();
|
||||
|
||||
|
@ -47,6 +47,12 @@ The address template is 0 1 0 0 - 1 A2 A1 A0 ==> 0x48 if all address pin
|
||||
| 1 | 1 | 1 | 0x4F |
|
||||
|
||||
|
||||
#### Related
|
||||
|
||||
- https://github.com/RobTillaart/LTC2991
|
||||
- https://github.com/RobTillaart/temperature converters
|
||||
|
||||
|
||||
## Interface
|
||||
|
||||
```cpp
|
||||
@ -58,11 +64,9 @@ The address template is 0 1 0 0 - 1 A2 A1 A0 ==> 0x48 if all address pin
|
||||
- **LTC2991(const uint8_t address, TwoWire \*wire = Wire)**
|
||||
The address is 0x48..0x4F depending on the address pins.
|
||||
The library does not check the range.
|
||||
- **bool begin(const uint8_t sda, const uint8_t scl)** for ESP32 and ESP8266.
|
||||
Initializes the class and sets the I2C pins.
|
||||
Returns true if the LTC2991 address is on the I2C bus.
|
||||
- **bool begin()** UNO ea. initializes the class.
|
||||
Returns true if the LTC2991 address is on the I2C bus.
|
||||
Returns true if the LTC2991 address is on the I2C bus.
|
||||
Note: do call **Wire.begin()** before **begin()**
|
||||
- **bool isConnected()** Returns true if the LTC2991 address is on the I2C bus.
|
||||
- **uint8_t getAddress()** Returns the address set in the constructor.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "LTC2991",
|
||||
"keywords": "voltage,temperature,differential,PWM",
|
||||
"description": "Arduino library for a LTC2991",
|
||||
"description": "Arduino library for a LTC2991 temperature and voltage control IC",
|
||||
"authors":
|
||||
[
|
||||
{
|
||||
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/LTC2991.git"
|
||||
},
|
||||
"version": "0.1.6",
|
||||
"version": "0.2.0",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,8 +1,8 @@
|
||||
name=LTC2991
|
||||
version=0.1.6
|
||||
version=0.2.0
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for LTC2991
|
||||
sentence=Arduino library for LTC2991 temperature and voltage control IC
|
||||
paragraph=
|
||||
category=Data Processing
|
||||
url=https://github.com/RobTillaart/LTC2991
|
||||
|
Loading…
Reference in New Issue
Block a user