#include <Arduino.h>
const int microphonePin = 25; // Connect the Potentiometer to GPIO36 (A0)
const int speakerPin = 25; // Connect the Buzzer to GPIO25
void setup() {
Serial.begin(115200);
pinMode(microphonePin, INPUT);
pinMode(speakerPin, OUTPUT);
}
void loop() {
// Transmitter
int sensorValue = analogRead(microphonePin);
Serial.println(sensorValue); // Output for debugging
delay(50); // Adjust delay as needed
// Receiver
sensorValue = analogRead(microphonePin); // Read from the same pin as transmitter
analogWrite(speakerPin, sensorValue / 4); // Adjust the divisor for volume control
}