Converts tempSensor.value to an easy to read temperature in either the Celsius or Fahrenheit scales.
tempSensor.C
and tempSensor.F
are properties of the tempSensor analog object. tempSensor.C
converts the raw value to Celsius, tempSensor.F
converts the raw value to Fahrenheit.
onBoardEvent(tempSensor, "data", function(event) { setNumber("temperature", tempSensor.F); });
onBoardEvent(tempSensor, "data", function(event) { setNumber("temperature", tempSensor.C); });
Found a bug in the documentation? Let us know at documentation@code.org