Scheme |
/*
* Monitor for sound sensor
*/
int micPin = 2; // select the input pin
int ledPin = 13; // select the pin for the LED
int val = 0;
int amp = 0;
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600);
}
void loop() {
val = analogRead(micPin);
amp = (val >= 512) ? val - 512 : 512 - val; //it is a ternary operator. X = A ? B : C; if A is true X = B, otherwise C
if (amp > 100)
{
digitalWrite(ledPin, HIGH);
delay(10);
}
else
{
digitalWrite(ledPin, LOW);
}
Serial.println(amp);
}
There is shocking news in the sports betting world.
ReplyDeleteIt's been said that every bettor must watch this,
Watch this now or stop placing bets on sports...
Sports Cash System - SPORTS CASINO ROBOT
Really very informative and creative content.
ReplyDeleteCondenser
I was only 21 when i had akj condensor mic. i had buy condenser mic from an online store on amazon. The working experience was fabulous. Now i am 26 and again i am planning for the next generation. I will buy as soon as possible within upcoming days......
ReplyDelete