Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define LEDstrip
- void setup()
- {
- pinMode(A1,INPUT); //SparkFun Electret Microphone Breakout connected to Analog Pin 7
- pinMode(13, OUTPUT);
- pinMode(12, OUTPUT);
- pinMode(11, OUTPUT);
- }
- //this function will make the LED dim once the SparkFun Electret Microphone Breakout sends a 1 signal, and then returns to to recorded brightness.
- void loop()
- {
- boolean soundstate = digitalRead(A1);
- if (soundstate == 1) {
- analogWrite(11, 188);
- analogWrite(12, 255);
- analogWrite(13, 255);
- delay(10);
- }
- else{
- analogWrite(11,0);
- analogWrite(12,0);
- analogWrite(13,0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement