Arduino, Cpp.
to analog pin 0 const int threshold = 100; // Threshold value to decide when the detected sound is a knock or not // These variables will change: int sensorReading = 0; // Variable to store the value read from the sensor pin int ledState = LOW; // Variable used to store the last LED status, to