This Python program uses a microcontroller and sound sensor to control a light bulb. The program reads the input from the sound sensor and uses it to detect clapping. When a valid clapping pattern is detected, the program toggles the light on or off.
The program includes several configurable parameters that can be adjusted to change its behavior:
The minimum sound level required to detect a clap. This value should be adjusted based on the sensitivity of the sound sensor and the distance between the sensor and the clapper.
The time when the last clap was detected. This value is used to determine the timing of the clapping pattern.
The time when the light was last turned on or off. This value is used to prevent the light from being toggled multiple times in response to a single clapping pattern.
This program is licensed under the MIT License. See the LICENSE file for more details.