Skip to content

Instantly share code, notes, and snippets.

@ibanezmatt13
Created June 4, 2014 21:13
Show Gist options
  • Save ibanezmatt13/fee931b99d7f1f1d87c6 to your computer and use it in GitHub Desktop.
Save ibanezmatt13/fee931b99d7f1f1d87c6 to your computer and use it in GitHub Desktop.
int buzzer = 13;
int dit_pin = 2;
const int dit_delay = 50000;
void setup()
{
pinMode(buzzer, OUTPUT);
pinMode(dit_pin, INPUT);
attachInterrupt(0, dit, LOW); // uses pin 2 as external interrupt
}
void dit()
{
digitalWrite(buzzer, HIGH);
delayMicroseconds(dit_delay);
digitalWrite(buzzer, LOW);
delayMicroseconds(dit_delay);
}
void loop(){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment