Created
November 20, 2014 21:21
-
-
Save staceymakes/49a1ee4e8a03b8858b88 to your computer and use it in GitHub Desktop.
Calling Spark Cloud API on Interval and starting Babylon.js Particle system
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
setInterval(function(){ | |
$.ajax("https://api.spark.io/v1/devices/{YOUR_SPARK_ID}/pressure?access_token={YOUR_ACCESS_TOKEN}") | |
.done(function(obj){ | |
if(obj.result < 10){ | |
scene.particleSystem.start(); | |
}else{ | |
scene.particleSystem.stop(); | |
} | |
}) | |
},1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment