0.1.3 PIR

This commit is contained in:
Rob Tillaart 2023-11-15 11:53:10 +01:00
parent 320117c9c6
commit 223fbfe938
6 changed files with 31 additions and 8 deletions

View File

@ -6,12 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.3] - 2023-11-15
- update readme.md
## [0.1.2] - 2022-12-15
- add changed(), read() + compare with the last value.
- update documentation / comments
- add performance measure example
## [0.1.1] - 2022-12-12
- first released version

View File

@ -1,7 +1,7 @@
//
// FILE: PIR.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2022-08-13
// PURPOSE: PIR library for Arduino.
// URL: https://github.com/RobTillaart/PIR

View File

@ -2,7 +2,7 @@
//
// FILE: PIR.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2022-08-13
// PURPOSE: PIR library
// URL: https://github.com/RobTillaart/PIR
@ -11,7 +11,7 @@
#include "Arduino.h"
#define PIR_LIB_VERSION (F("0.1.2"))
#define PIR_LIB_VERSION (F("0.1.3"))
//
#define PIR_OK 0x00
@ -53,7 +53,6 @@ public:
uint8_t read(uint8_t index);
protected:
uint8_t _pins[8] = {0,0,0,0, 0,0,0,0};
uint8_t _count = 0;

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/PIR/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/PIR/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PIR/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/PIR/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PIR/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/PIR.svg)](https://github.com/RobTillaart/PIR/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PIR/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/PIR.svg?maxAge=3600)](https://github.com/RobTillaart/PIR/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/PIR.svg)](https://registry.platformio.org/libraries/robtillaart/PIR)
# PIR
@ -26,6 +29,10 @@ Instead of PIR sensors one can add other DigitalOut sensors or even switches.
## Interface
```cpp
#include "PIR.h"
```
#### Base
- **PIR()** constructor. Allocated room for 8 PIRs.
@ -41,6 +48,7 @@ Returns a bit mask of HIGH / LOW values.
Not used slots will return 0.
- **uint8_t read(uint8_t index)** read a specific PIR sensor.
Faster than read() above.
Does not affect **lastValue()**
- **uint8_t lastValue()** returns last values read (bit mask) with read().
- **uint8_t changed()** returns bit mask of pins that changed since last read().
This can improve processing in some cases.
@ -49,13 +57,16 @@ This can improve processing in some cases.
## Future
#### Must
- update documentation
#### Should
- add examples
- interrupts?
#### Could
- investigate PIR16 PIR32 class that can hold more
- think MEGA2560.
- or dynamic allocation? 0.2.0
@ -65,6 +76,7 @@ This can improve processing in some cases.
- **clear()** to reset whole object?
#### Wont
- PIR class based upon a PCF8574?
- separate class
- timestamp per PIR
@ -77,3 +89,12 @@ This can improve processing in some cases.
- **remove(pin)**
- difficult, more admin, expectations...
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,

View File

@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/PIR.git"
},
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "PIR.h"
}

View File

@ -1,5 +1,5 @@
name=PIR
version=0.1.2
version=0.1.3
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=PIR library for Arduino.