0.2.0 rotaryDecoder

This commit is contained in:
Rob Tillaart 2023-11-21 15:30:00 +01:00
parent 19bf1b6290
commit 8d31354f03
7 changed files with 22 additions and 32 deletions

View File

@ -6,13 +6,18 @@ 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-11-21
- simplify begin() interface - breaking change
- update readme.md
----
## [0.1.4] - 2023-09-22
- add Wire1 support for ESP32
- moved code from .h to .cpp
- update readme.md
- minor edits
## [0.1.3] - 2022-11-23
- add changelog.md
- add RP2040 to build-CI

View File

@ -25,6 +25,12 @@ library assumes these are used. Furthermore it is advised to connect the free PC
pins to GND so you will not get unintended interrupts.
#### Related
- https://github.com/RobTillaart/rotaryDecoderSwitch
- https://github.com/RobTillaart/PCF8574
## Interface
```cpp
@ -34,10 +40,6 @@ pins to GND so you will not get unintended interrupts.
#### Constructor
- **rotaryDecoder(const int8_t address, TwoWire \*wire = Wire);**
- **bool begin(uint8_t sda, uint8_t scl, uint8_t count = 4)** ESP32 ea initializes the class
by setting the I2C sda and scl pins.
count is the number of rotary encoders connected. (Max 4 per PCF8574)
Returns true if the PCF8574 is on the I2C bus.
- **bool begin(uint8_t count = 4)** UNO ea. initializes the class.
count is the number of rotary encoders connected. (Max 4 per PCF8574)
Returns true if the PCF8574 is on the I2C bus.
@ -114,23 +116,19 @@ See examples..
- update documentation
- picture how to connect e.g two rotary encoders which pins to used
#### Should
- test with a high speed drill like a Dremel-tool.
#### Could
- invert flag to adjust to RE that give their pulse just the other way around?
- setInvert(bool); getInvert();
- per channel / all?
#### Wont
## Support
If you appreciate my libraries, you can support the development and maintenance.

View File

@ -15,9 +15,10 @@
"type": "git",
"url": "https://github.com/RobTillaart/rotaryDecoder.git"
},
"version": "0.1.4",
"version": "0.2.0",
"license": "MIT",
"frameworks": "*",
"platforms": "*",
"headers": "rotaryDecoder.h"
}

View File

@ -1,5 +1,5 @@
name=rotaryDecoder
version=0.1.4
version=0.2.0
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library to rotary decoder with a PCF8574

View File

@ -1,7 +1,7 @@
//
// FILE: rotaryDecoder.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.1.4
// VERSION: 0.2.0
// DATE: 2021-05-08
// PURPOSE: rotary decoder library for Arduino
// URL: https://github.com/RobTillaart/rotaryDecoder
@ -21,23 +21,11 @@ rotaryDecoder::rotaryDecoder(const int8_t address, TwoWire *wire)
}
#if defined (ESP8266) || defined(ESP32)
bool rotaryDecoder::begin(uint8_t sda, uint8_t scl, uint8_t count)
{
_count = count;
if (_count > 4) _count = 4;
_wire->begin(sda, scl);
if (! isConnected()) return false;
return true;
}
#endif
bool rotaryDecoder::begin(uint8_t count)
{
_count = count;
if (_count > 4) _count = 4;
_wire->begin();
if (! isConnected()) return false;
return true;
}

View File

@ -2,7 +2,7 @@
//
// FILE: rotaryDecoder.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.4
// VERSION: 0.2.0
// DATE: 2021-05-08
// PURPOSE: rotary decoder library for Arduino
// URL: https://github.com/RobTillaart/rotaryDecoder
@ -11,7 +11,7 @@
#include "Arduino.h"
#include "Wire.h"
#define ROTARY_DECODER_LIB_VERSION (F("0.1.4"))
#define ROTARY_DECODER_LIB_VERSION (F("0.2.0"))
class rotaryDecoder
@ -19,10 +19,6 @@ class rotaryDecoder
public:
explicit rotaryDecoder(const int8_t address, TwoWire *wire = &Wire);
#if defined (ESP8266) || defined(ESP32)
bool begin(uint8_t sda, uint8_t scl, uint8_t count = 4);
#endif
bool begin(uint8_t count = 4);
bool isConnected();

View File

@ -56,4 +56,6 @@ unittest(test_constructor)
unittest_main()
// --------
// -- END OF FILE --