Hi guys,
I’m working on the project that required to have a button that when the user click and hold the button, it will keep sending string command to particle cloud. This is what I got so far:
Document Click and hold<script>
var counter;
function end() {
clearInterval(counter)
}
function display(value) {
if (value == 1) {
counter = setInterval(function () {
paramStr = "f";
}, 200);
}
var requestURL = "https://api.particle.io/v1/devices/deviceID/Car/";
$.post(requestURL, { params: paramStr, access_token: accessToken });
}
</script>