tempSensor.F/C

Category:Circuit

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.

Examples

Thermometer using Celsius

onBoardEvent(tempSensor, "data", function(event) {
  setNumber("temperature", tempSensor.C);
});

Thermometer using Fahrenheit

onBoardEvent(tempSensor, "data", function(event) {
  setNumber("temperature", tempSensor.F);
});

Found a bug in the documentation? Let us know at documentation@code.org