Created
July 15, 2013 04:19
-
-
Save boxalljohn/5997472 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
// Example 4.2 | |
void setup() | |
{ | |
pinMode(8, OUTPUT); // speker on pin 8 | |
} | |
int del = 250; // for tone length | |
int lowrange = 2000; // the lowest frequency value to use | |
int highrange = 4000; // the highest... | |
void loop() | |
{ | |
// increasing tone | |
for (int a = lowrange; a<=highrange; a++) | |
{ | |
tone (8, a, del); | |
} | |
// decreasing tone | |
for (int a = highrange; a>=lowrange; a--) | |
{ | |
tone (8, a, del); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment