UNPKG

obniz

Version:

obniz sdk for javascript

40 lines (27 loc) 740 B
# Temperature Sensor - S8100B インピーダンスがない? ![photo of AnalogTempratureSensor](./wired.png) ## wired(obniz, {vcc, gnd, output}) ```javascript // Javascript Example var tempsens = obniz.wired("S8100B", { gnd:1 , output:2, vcc:0}); ``` ## onchange callback function for temperature change. Unit of temp is Celsius ```javascript // Javascript Example var tempsens = obniz.wired("S8100B", { gnd:1 , output:2, vcc:0}); tempsens.onchange = function(temp){ console.log(temp) }; ``` ## [await]getWait get temperature change. Unit of temp is Celsius ```javascript // Javascript Example var tempsens = obniz.wired("S8100B", { gnd:1 , output:2, vcc:0}); var temp = await tempsens.getWait(); console.log(temp); ```