Created
January 18, 2018 16:13
-
-
Save fusspawn/79f565fd5d6484adc922c04f7f2407ef 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
byte currentPot; | |
byte lastPot; | |
function between(byte value, byte min, byte max) : bool { | |
return (value >= min && value =< max); | |
} | |
bool isGoingUp = currentPot > lastPot; | |
if(isGoingUp && between(currentPot, 0, 25)) { | |
playSound("going_up_0_25.wav"); | |
} else if(!isGoingUp && between(currentPot, 0, 25)) { | |
playSound("going_down_0_25.wav"); | |
} | |
if(isGoingUp && between(currentPot, 25, 50)) { | |
playSound("going_up_25_50.wav"); | |
} else if(!isGoingUp && between(currentPot, 25, 50)) { | |
playSound("going_down_25_50.wav"); | |
} | |
// ect ect.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment