Accessor: TemperatureSensor

TemperatureSensor

A dummy accessor for a temperature sensor that outputs a range of temperatures varying from a low of 0 degrees centigrade up to 100 degrees in steps that default to 10 degrees every second.

The control input can be used to vary the period of sampling. To change the period, provide an input object with property "period" that specifies the period in milliseconds. The period defaults to 1 sample per second. A period of 0 will stop the sampling.

The control input can also be used to vary the increment added to each sample. To change the increment, provide an input object with property "step" that specifies the increment in degrees.

The output is a JSON object with the following properties:

  • name: "Temperature sensor"
  • units: "Degree centigrade"
  • temperature: a number.
Version:
  • $$Id$$
Author:
  • Edward A. Lee (eal@eecs.berkeley.edu)
Source:
Inputs:
Name Type Description
control A JSON object that can have two properties, "step", a number and "period", also a number.
Outputs:
Name Type Description
data A JSON object.