#define led 13 #define sound 3 boolean trig = true; boolean state = true; void setup() { pinMode(led, OUTPUT); pinMode(sound, INPUT); Serial.begin(9600); } void loop() { trig = digitalRead(sound); if(trig == false && state == false) { digitalWrite(led, HIGH); Serial.println("ON"); state = true; delay(500); } else if(trig == false && state == true) { digitalWrite(led, LOW); Serial.println("OFF"); state = false; delay(500); } } here ya go people I wrote it for you (-:
How can I use this in a system that deters barking dogs? I currently have a system I wired together that runs high pitch piezo tweeter speakers on a remote but that doesn't work when I'm not home to activate it. The over the counter bark deterrents are useless. I need it to stay on for 30 seconds when it detects noise but no shut off when it detects the second bark. Any ideas?
I'm having a bit of trouble understanding what the Comparison Operator is in the IF and ELSE IF statements are...? Can you help me out? I have input your code into my IDE but can't complete the program properly at these points. I'm not sure what to input here...Help Please...
Hi, I'd highly recommend you buy a book about C programming or/and a book which explains the basic principle of programming. For pure C, only one book, by the inventors of the C Language : "The C Programming Language", B Kernighan & D Ritchie. For a sweet intriduction to Arduino and basic programming concepts (including the if then else logic), "Programming Arduino" by Simon Monk is a classic that I can recommend. Hope this helps.
Hi. Could anybody please post a build of Arduino decibel meter for an Airgun with shown Max last reading. Small size would be preferable, possibly Arduino Nano and Oled screen. Most Android Phone Apps don't work correctly as the phone kills the Microphone sensitivity automatically and sampling isn't fast enough. Thanks in advance. Good Video BTW.
Great Demonstration, I am not sure if you know already but these sensors are called KY-038. Thanks for sharing.
#define led 13
#define sound 3
boolean trig = true;
boolean state = true;
void setup()
{
pinMode(led, OUTPUT);
pinMode(sound, INPUT);
Serial.begin(9600);
}
void loop()
{
trig = digitalRead(sound);
if(trig == false && state == false)
{
digitalWrite(led, HIGH);
Serial.println("ON");
state = true;
delay(500);
}
else if(trig == false && state == true)
{
digitalWrite(led, LOW);
Serial.println("OFF");
state = false;
delay(500);
}
}
here ya go people I wrote it for you (-:
i luv u ♥
How can I use this in a system that deters barking dogs? I currently have a system I wired together that runs high pitch piezo tweeter speakers on a remote but that doesn't work when I'm not home to activate it. The over the counter bark deterrents are useless. I need it to stay on for 30 seconds when it detects noise but no shut off when it detects the second bark. Any ideas?
Thanks so much. I'm doing a mark Rober project, and I'm no expert
I'm having a bit of trouble understanding what the Comparison Operator is in the IF and ELSE IF statements are...? Can you help me out? I have input your code into my IDE but can't complete the program properly at these points. I'm not sure what to input here...Help Please...
Hi,
I'd highly recommend you buy a book about C programming or/and a book which explains the basic principle of programming.
For pure C, only one book, by the inventors of the C Language : "The C Programming Language", B Kernighan & D Ritchie.
For a sweet intriduction to Arduino and basic programming concepts (including the if then else logic), "Programming Arduino" by Simon Monk is a classic that I can recommend. Hope this helps.
Does this code work on Mac pr is it just PC?
Of course will this work for Mac OS X.
Really useful demonstration.
whats the name of the plate?
Hi. Could anybody please post a build of Arduino decibel meter for an Airgun with shown Max last reading. Small size would be preferable, possibly Arduino Nano and Oled screen. Most Android Phone Apps don't work correctly as the phone kills the Microphone sensitivity automatically and sampling isn't fast enough. Thanks in advance. Good Video BTW.
Clap on, clap off