soundSensor
Category:Circuit

soundSensor
, lightSensor
, and tempSensor
are objects representing the analog sensors on the Circuit Playground. Internally soundSensor
is connected to the analog pin A4, lightSensor
is connected to analog pin A5, and tempSensor
is connected to analog pin A0.
Properties and Methods
soundSensor.value
- A number that representing the current input value of the sensor. By default this will range from 0-1023, but that range can be overridden withsoundSensor.setScale()
soundSensor.setScale()
- A method that allows you to change the range of numbers read in by a sensor.tempSensor.F
andtempSensor.C
- Special properties for thetempSensor
which convert the raw input value to either Fahrenheit or Celsius.
Events
- "change" - Fired any time the input value of the specified sensor changes
- "data" - Fired every 100 milliseconds.
Syntax
soundSensor
Found a bug in the documentation? Let us know at support@code.org.