lightSensor

Category:Circuit Playground

Represents the analog light sensor.

lightSensor in an object representing the analog light sensor on the circuit playground and is connected internally to analog pin A5. This object can be used to detect changes in light in the room.

Properties and Methods

  • lightSensor.setScale() - Sets the scale for how the values are going to be weighted.
  • lightSensor.value - The raw value of what the lightSensor is picking up.

Events

  • data - Updates the lightSensor's value every 100 milliseconds.
  • change - Updates the lightSensor's value every time a change has been detected.

Additional Information

From http://johnny-five.io/api/sensor/

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