Hardware Reference
In-Depth Information
This function is called when the SensorTag is disconnected.
Normally JavaScript does everything synchronously. Here, we want to do the fol-
lowing asynchronously — that is, step-by-step, one after the other. We are passing
an array to async.series() , which contains the functions to run in the order in
which they appear in the array.
Connect to the SensorTag.
Discover what the SensorTag can do. This is necessary before we can give it any
commands.
Enable temperatures. We don't get a temperature reading yet. Rather, we're instruct-
ing it to begin reading and report back when they are ready.
Wait a bit for the first temperatures to be read.
This specifies the function to call every time a temperature is ready. The callback is
passed objectTemperature (what's read by the touchless IR sensors) and
ambientTemperature (the temperature inside the SensorTag). Try putting your
hand in front of the device; the objectTemperature should go up.
Define the callback for when the temperature changes.
This commented-out code is used when you want to turn off the temperature read-
ings.
 
 
 
 
 
 
 
Search WWH ::




Custom Search