Last active
February 16, 2017 13:45
-
-
Save sw13sg/4a9be78733d4f83b33590f3bf5e70740 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
Expressive Wearable: Circada | |
Sinead Wickham (2504397) | |
GDES-3015-001 Wearable Computing | |
OCAD Univeristy | |
Created on Feb 16, 2017 | |
Based on: | |
Make-Wearable-Electronics/MWE_Ch08_Tone, Kate Hartman, https://github.com/katehartman/Make-Wearable-Electronics/blob/master/MWE_Ch08_Tone/MWE_Ch08_Tone.ino | |
Make-Wearable-Electronics/MWE_Ch08_Buzzer, Kate Hartman, https://github.com/katehartman/Make-Wearable-Electronics/blob/master/MWE_Ch08_Buzzer/MWE_Ch08_Buzzer.ino | |
*/ | |
int B = 1976; | |
int D = 1175; | |
int F = 1397; | |
int buzzerPin = 9; | |
int buttonPin = 12; | |
int buttonValue; | |
void setup() { | |
pinMode (buzzerPin, OUTPUT); | |
pinMode (buttonPin, INPUT_PULLUP); | |
} | |
void loop() { | |
buttonValue = digitalRead(buttonPin); | |
if (buttonValue == HIGH) { | |
tone(buzzerPin, B, 50); | |
delay(75); | |
tone(buzzerPin, B, 50); | |
delay(10000); | |
} else { | |
tone(buzzerPin, B, 200); | |
delay(400); | |
tone(buzzerPin, D, 200); | |
delay(400); | |
tone(buzzerPin, F, 200); | |
delay(400); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment