mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.1.6 MT8870
This commit is contained in:
parent
0bee58b634
commit
67fc27db27
@ -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/).
|
||||
|
||||
|
||||
## [0.1.6] - 2023-11-13
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.1.5] - 2022-11-18
|
||||
- add RP2040 in build-CI
|
||||
- add changelog.md
|
||||
@ -13,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- update keywords.txt to match .h file
|
||||
- move code from .h to .cpp
|
||||
|
||||
|
||||
## [0.1.4] - 2021-12-22
|
||||
- update library.json
|
||||
- update license
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: MT8870.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.5
|
||||
// VERSION: 0.1.6
|
||||
// DATE: 2019-02-11
|
||||
// PURPOSE: Arduino library for MT8870 DTMF decoder (breakout)
|
||||
// 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;
|
||||
for (uint8_t p = 0; p < 4; p++)
|
||||
{
|
||||
pinMode(_q[p], INPUT); // PULLUP ?
|
||||
pinMode(_q[p], INPUT); // PULLUP ?
|
||||
}
|
||||
pinMode(_STQ, INPUT);
|
||||
}
|
||||
@ -68,5 +68,5 @@ uint32_t MT8870::lastTimeRead()
|
||||
};
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -2,17 +2,16 @@
|
||||
//
|
||||
// FILE: MT8870.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.5
|
||||
// VERSION: 0.1.6
|
||||
// DATE: 2019-02-11
|
||||
// PURPOSE: Arduino library for MT8870 DTMF decoder (breakout)
|
||||
// URL: https://github.com/RobTillaart/MT8870
|
||||
// https://www.tinytronics.nl/shop/nl/sensoren/geluid/mt8870-dtmf-module
|
||||
//
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define MT8870_LIB_VERSION (F("0.1.5"))
|
||||
#define MT8870_LIB_VERSION (F("0.1.6"))
|
||||
|
||||
|
||||
class MT8870
|
||||
@ -36,5 +35,5 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF 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-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)
|
||||
[![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)
|
||||
[![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
|
||||
@ -23,10 +26,10 @@ DTMF tones, uses one from A..D and one from E..H.
|
||||
|
||||
| Name | Frequency |
|
||||
|:------:|------------:|
|
||||
| A | 697 Hz |
|
||||
| B | 770 Hz |
|
||||
| C | 852 Hz |
|
||||
| D | 941 Hz |
|
||||
| A | 697 Hz |
|
||||
| B | 770 Hz |
|
||||
| C | 852 Hz |
|
||||
| D | 941 Hz |
|
||||
| E | 1209 Hz |
|
||||
| F | 1336 Hz |
|
||||
| G | 1477 Hz |
|
||||
@ -35,6 +38,10 @@ DTMF tones, uses one from A..D and one from E..H.
|
||||
|
||||
## Interface
|
||||
|
||||
```cpp
|
||||
#include "MT8870.h"
|
||||
```
|
||||
|
||||
- **MT8870()** constructor
|
||||
- **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
|
||||
@ -43,7 +50,7 @@ with one MT8870 object by calling **begin()** with other pins.
|
||||
- **Q1..Q4** = data pins.
|
||||
- Calling begin resets the **lastRead** char
|
||||
- **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 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.
|
||||
@ -57,11 +64,13 @@ See examples.
|
||||
|
||||
## Future
|
||||
|
||||
#### must
|
||||
#### Must
|
||||
|
||||
- improve documentation
|
||||
- keypad matrix, which key generates which tones
|
||||
|
||||
#### should
|
||||
#### Should
|
||||
|
||||
- test setup
|
||||
- add examples
|
||||
- DMTF with a PCF8574
|
||||
@ -69,10 +78,22 @@ See examples.
|
||||
- DMTF with less keys (less pins)
|
||||
- DMTF over interrupt triggered by STQ line
|
||||
|
||||
#### could
|
||||
#### Could
|
||||
|
||||
- buffer like Serial? (how to fill? interrupt? example sketch?)
|
||||
- read part of stream interface?
|
||||
- DMTF tone generation?
|
||||
- MCP_DAC
|
||||
- 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,
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/MT8870.git"
|
||||
},
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=MT8870
|
||||
version=0.1.5
|
||||
version=0.1.6
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for MT8870 DTMF decoder
|
||||
|
Loading…
Reference in New Issue
Block a user