Skip to content

Instantly share code, notes, and snippets.

@toolboc
Last active August 29, 2015 14:13
Show Gist options
  • Save toolboc/bc3bffe60893befba3cf to your computer and use it in GitHub Desktop.
Save toolboc/bc3bffe60893befba3cf to your computer and use it in GitHub Desktop.
Water Experiment
int frequencyInHz = 51;
int led = 13;
float restTime = (1/frequencyInHz) * 1000;;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT); // Configure the pin for OUTPUT so you can turn on the LED
tone(8, frequencyInHz);
}
void loop() {
// put your main code here, to run repeatedly:
delay(restTime);
digitalWrite(led, LOW);
delay(restTime);
digitalWrite(led,HIGH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment