Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fizban99/microbit_ky038
Micro:bit micropython library to calibrate a sound sensor KY038
https://github.com/fizban99/microbit_ky038
Last synced: 3 months ago
JSON representation
Micro:bit micropython library to calibrate a sound sensor KY038
- Host: GitHub
- URL: https://github.com/fizban99/microbit_ky038
- Owner: fizban99
- License: mit
- Created: 2017-03-21T09:26:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-24T16:31:30.000Z (almost 3 years ago)
- Last Synced: 2024-02-28T11:20:18.870Z (4 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Lists
- awesome-microbit-zh - KY038 - 校准和使用 KY038 声音传感器的MicroPython库,包含拍手计数器功能。 (编程 / Python)
- awesome-microbit - KY038 - Library to calibrate and use a sound sensor KY038, including clap counter functionality. (👩💻 Programming / 🐍 Python)
README
micropython library to calibrate and use a sound sensor KY038
##############################################################This library helps calibrating a sound sensor KY038 with the micro:bit. It also provides a clap counter functionality. It assumes the Digital output of the sound sensor is connected to pin0 of the micro:bit. It uses an analog input, since the digital input seems not to be very reliable powering the sensor with 3V. Power and ground of the sensor are also connected to the micro:bit.
.. contents::
.. section-numbering::
Main features
=============* Helps calibrate the sound sensor showing an arrow on the micro:bit indicating the direction to turn the potentiometer
* Has a clap counter includedLibrary usage
=============calibrate()
+++++++++++Inititalizes the calibration routine. The micro:bit will display an arrow indicating the direction that you should be turning the potentiometer with a screwdriver.
.. code-block:: python
from ky038 import KY038
KY038.calibrate()count_claps()
+++++++++++++Count the number of claps or any consecutive sudden sound.
.. code-block:: python
from ky038 import KY038
KY038.calibrate()
while True:
print(KY038.count_claps())