0.1.6 MT8870

This commit is contained in:
Rob Tillaart 2023-11-13 17:37:07 +01:00
parent 0bee58b634
commit 67fc27db27
6 changed files with 41 additions and 18 deletions

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.6] - 2023-11-13
- update readme.md
## [0.1.5] - 2022-11-18 ## [0.1.5] - 2022-11-18
- add RP2040 in build-CI - add RP2040 in build-CI
- add changelog.md - add changelog.md
@ -13,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- update keywords.txt to match .h file - update keywords.txt to match .h file
- move code from .h to .cpp - move code from .h to .cpp
## [0.1.4] - 2021-12-22 ## [0.1.4] - 2021-12-22
- update library.json - update library.json
- update license - update license

View File

@ -1,7 +1,7 @@
// //
// FILE: MT8870.cpp // FILE: MT8870.cpp
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.5 // VERSION: 0.1.6
// DATE: 2019-02-11 // DATE: 2019-02-11
// PURPOSE: Arduino library for MT8870 DTMF decoder (breakout) // PURPOSE: Arduino library for MT8870 DTMF decoder (breakout)
// URL: https://github.com/RobTillaart/MT8870 // URL: https://github.com/RobTillaart/MT8870
@ -20,7 +20,7 @@ void MT8870::begin(uint8_t STQ, uint8_t Q1, uint8_t Q2, uint8_t Q3, uint8_t Q4)
_q[3] = Q4; _q[3] = Q4;
for (uint8_t p = 0; p < 4; p++) for (uint8_t p = 0; p < 4; p++)
{ {
pinMode(_q[p], INPUT); // PULLUP ? pinMode(_q[p], INPUT); // PULLUP ?
} }
pinMode(_STQ, INPUT); pinMode(_STQ, INPUT);
} }
@ -68,5 +68,5 @@ uint32_t MT8870::lastTimeRead()
}; };
// -- END OF FILE -- // -- END OF FILE --

View File

@ -2,17 +2,16 @@
// //
// FILE: MT8870.h // FILE: MT8870.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.5 // VERSION: 0.1.6
// DATE: 2019-02-11 // DATE: 2019-02-11
// PURPOSE: Arduino library for MT8870 DTMF decoder (breakout) // PURPOSE: Arduino library for MT8870 DTMF decoder (breakout)
// URL: https://github.com/RobTillaart/MT8870 // URL: https://github.com/RobTillaart/MT8870
// https://www.tinytronics.nl/shop/nl/sensoren/geluid/mt8870-dtmf-module // https://www.tinytronics.nl/shop/nl/sensoren/geluid/mt8870-dtmf-module
//
#include "Arduino.h" #include "Arduino.h"
#define MT8870_LIB_VERSION (F("0.1.5")) #define MT8870_LIB_VERSION (F("0.1.6"))
class MT8870 class MT8870
@ -36,5 +35,5 @@ private:
}; };
// -- END OF FILE -- // -- END OF FILE --

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/MT8870/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino CI](https://github.com/RobTillaart/MT8870/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/MT8870/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/MT8870/actions/workflows/arduino-lint.yml) [![Arduino-lint](https://github.com/RobTillaart/MT8870/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/MT8870/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/MT8870/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MT8870/actions/workflows/jsoncheck.yml) [![JSON check](https://github.com/RobTillaart/MT8870/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MT8870/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/MT8870.svg)](https://github.com/RobTillaart/MT8870/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/MT8870/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/MT8870/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/MT8870.svg?maxAge=3600)](https://github.com/RobTillaart/MT8870/releases) [![GitHub release](https://img.shields.io/github/release/RobTillaart/MT8870.svg?maxAge=3600)](https://github.com/RobTillaart/MT8870/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/MT8870.svg)](https://registry.platformio.org/libraries/robtillaart/MT8870)
# MT8870 # MT8870
@ -23,10 +26,10 @@ DTMF tones, uses one from A..D and one from E..H.
| Name | Frequency | | Name | Frequency |
|:------:|------------:| |:------:|------------:|
| A | 697 Hz | | A | 697 Hz |
| B | 770 Hz | | B | 770 Hz |
| C | 852 Hz | | C | 852 Hz |
| D | 941 Hz | | D | 941 Hz |
| E | 1209 Hz | | E | 1209 Hz |
| F | 1336 Hz | | F | 1336 Hz |
| G | 1477 Hz | | G | 1477 Hz |
@ -35,6 +38,10 @@ DTMF tones, uses one from A..D and one from E..H.
## Interface ## Interface
```cpp
#include "MT8870.h"
```
- **MT8870()** constructor - **MT8870()** constructor
- **void begin(uint8_t STQ, uint8_t Q1, uint8_t Q2, uint8_t Q3, uint8_t Q4)** defines which pins to use. - **void begin(uint8_t STQ, uint8_t Q1, uint8_t Q2, uint8_t Q3, uint8_t Q4)** defines which pins to use.
Technically it is possible to have readout multiple decoders Technically it is possible to have readout multiple decoders
@ -43,7 +50,7 @@ with one MT8870 object by calling **begin()** with other pins.
- **Q1..Q4** = data pins. - **Q1..Q4** = data pins.
- Calling begin resets the **lastRead** char - Calling begin resets the **lastRead** char
- **bool available()** returns true if there is a DMTF signal - **bool available()** returns true if there is a DMTF signal
- **char read()** reads the character available. returns 255 if no signal available. - **char read()** reads the character available. Returns 255 if no signal available.
- **uint8_t readRaw()** returns 0 .. 15 or 255 if no signal is available. - **uint8_t readRaw()** returns 0 .. 15 or 255 if no signal is available.
- **uint8_t lastRaw()** returns the last code read 0 .. 15 or 255 if no signal available. - **uint8_t lastRaw()** returns the last code read 0 .. 15 or 255 if no signal available.
Note this is a cached value from a readRaw / read call. Note this is a cached value from a readRaw / read call.
@ -57,11 +64,13 @@ See examples.
## Future ## Future
#### must #### Must
- improve documentation - improve documentation
- keypad matrix, which key generates which tones - keypad matrix, which key generates which tones
#### should #### Should
- test setup - test setup
- add examples - add examples
- DMTF with a PCF8574 - DMTF with a PCF8574
@ -69,10 +78,22 @@ See examples.
- DMTF with less keys (less pins) - DMTF with less keys (less pins)
- DMTF over interrupt triggered by STQ line - DMTF over interrupt triggered by STQ line
#### could #### Could
- buffer like Serial? (how to fill? interrupt? example sketch?) - buffer like Serial? (how to fill? interrupt? example sketch?)
- read part of stream interface? - read part of stream interface?
- DMTF tone generation? - DMTF tone generation?
- MCP_DAC - MCP_DAC
- PWM + HW? - PWM + HW?
#### Wont
## 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,7 +15,7 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/MT8870.git" "url": "https://github.com/RobTillaart/MT8870.git"
}, },
"version": "0.1.5", "version": "0.1.6",
"license": "MIT", "license": "MIT",
"frameworks": "*", "frameworks": "*",
"platforms": "*", "platforms": "*",

View File

@ -1,5 +1,5 @@
name=MT8870 name=MT8870
version=0.1.5 version=0.1.6
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for MT8870 DTMF decoder sentence=Arduino library for MT8870 DTMF decoder