Hey.
I'm using the aurdino uno board for my home automation project. Basically it's an amplifier and for that i have installed two sensors.
Sound sensor
UV sensor
The sound sensor senses the frequency of our clap and switches on. The UV sensor calculates our distance from the amplifier and and then controls the volume.
I'm facing an issue with combining the codes.
Please help me with the same.
int currentValue;
int maxValue;
int minValue;
unsigned long timer;
int sampleSpan = 200; // Amount in milliseconds to sample data
int volume; // this roughly goes from 0 to 700
int ledpin = 7;
// I arbitrarily select 100 as the value above which the
//microphone is picking a loud noise.
if (volume > 400)
{
Serial.println(“Loud”);
digitalWrite(ledpin,HIGH);
} else
{
Serial.println(“Quiet”);
digitalWrite(7,LOW);
}