Created
July 25, 2015 14:30
-
-
Save robshep/c2c3794596fa8e4f324b to your computer and use it in GitHub Desktop.
code.js
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
var width = 0.7; // to 2.3 | |
var freq = 20; // to 100; | |
var i = null; | |
var go = function(){ | |
i = setInterval(function() { | |
digitalPulse(B10, 1, width); | |
}, freq); | |
}; | |
var stop = function(){ | |
clearInterval(i); | |
}; | |
var setFreq = function(fIn){ | |
freq = fIn; | |
stop(); | |
go(); | |
}; | |
var setWidth = function(wIn){ | |
width = wIn; | |
stop(); | |
go(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment