Created
June 4, 2014 21:13
-
-
Save ibanezmatt13/fee931b99d7f1f1d87c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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