Arduino: VOX Voice Operated Transmit

From OnnoWiki
Revision as of 02:45, 29 November 2021 by Onnowpurbo (talk | contribs) (Created page with " →‎14CORE TEST CODE FOR SOUND DETECTION: int MySound = 4; // Sound Sensor Connected to Pin 4 int MyRelay = 5; // Relay Module in Connected to Pin 5 void setup()...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


/*
14CORE TEST CODE FOR SOUND DETECTION
*/
int MySound = 4;   // Sound Sensor Connected to Pin 4
int MyRelay = 5;  // Relay Module in Connected to Pin 5

void setup()
{
  pinMode(MyRelay, OUTPUT);
  pinMode(MySound, INPUT);
}
void loop()
{
  if (digitalRead(MySound) == HIGH) 
  {                
    digitalWrite(MyRelay, HIGH);
    delay(10);    
  } else {
    digitalWrite(MyRelay, LOW);
  }
}