1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
int Sensor = A0;
void setup() {
Serial.begin(9600);
pinMode(Sensor, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
int Sound = analogRead(Sensor);
Serial.println(Sound);
if(Sound < 1000){
digitalWrite(13, HIGH);
}
else
digitalWrite(13,LOW);
}
|
cs |