Hardware Reference
In-Depth Information
Assign a callback to respond to the left and right button pushes.
If both buttons are pushed, pass the callback function to
sensorTag.notifySimpleKey() .
sensorTag.notifySimpleKey() doesn't do anything in this case, but it does
evaluate callback , allowing it to progress to the next and final state.
When we get to here, we disconnect from the SensorTag, which causes the code to
exit (see ) .
Here's some output from the code:
Be sure sensorTag is on
sensorTag = {"uuid":"9059af0b8457"}
connect
discoverServicesAndCharacteristics
enableIrTemperature
readIrTemperature
object temperature = 2.8 °C
ambient temperature = 0 °C
readSimpleRead
notifyIrTemperature
object temperature = 31.8 °C
ambient temperature = 24.8 °C
object temperature = 25.9 °C
ambient temperature = 24.8 °C
object temperature = 27.4 °C
ambient temperature = 24.8 °C
object temperature = 32.2 °C
ambient temperature = 24.8 °C
left: false right: true
left: true right: true
left: false right: false
disconnect
disconnected!
 
 
 
Search WWH ::




Custom Search