Created
October 8, 2019 03:53
-
-
Save heylimlim/f3e279c5eedb8341fa1dc51e5a3222e1 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
int speakerPin = 10; | |
const int fsrPin = A0; | |
int fsrReading; | |
void setup(void) { | |
Serial.begin(9600); | |
pinMode(speakerPin, OUTPUT); | |
} | |
void loop(void) { | |
fsrReading = analogRead(fsrPin); | |
Serial.println(fsrReading); | |
delay(10); if (fsrReading >=834) { | |
long frequency = 300; | |
tone(speakerPin, frequency ); | |
//delay(200); | |
noTone(speakerPin); | |
//delay(100); | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment