Arduino101LightSensor 光线传感器
The Arduino 101 Light Sensor component lets users receive data from a light sensor attached to the Arduino, however it can be used for any similar device that provides a linear analog signal based on some external phenomenon.
More Links<ul><li>Download a sample project</li><li>View the how to instructions for the Arduino 101 Light Sensor.</li></ul>
Properties
BluetoothDevice
– The BluetoothLE component with a connection to the Arduino 101.
Methods
IsSupported
– Tests whether the Bluetooth low energy device is broadcasting support for the service. If true, calls to TurnOn and TurnOff should work correctly. Otherwise an error will be reported through the Screen’s ErrorOccurred event.
ReadLightSensor
– Obtain the most recent reading from the light sensor as reported by the Arduino. On success, theLightSensorDataReceived
event will be run.
RequestLightSensorUpdates
– Request notification of updates for the light sensor attached to the Arduino 101. TheLightSensorDataReceived
event will be run as light sensor readings are received from the Arduino.
StopLightSensorUpdates
– Stop listening for notifications of light sensor readings from the Arduino. This only has an effect if there was a previous call toRequestLightSensorUpdates
. There may be additional pending messages that will be processed after this call.
Events
LightSensorDataReceived
– TheLightSensorDataReceived
event is run when a sample is received from the light sensor attached to the Arduino 101.
Parameters:
* <code>intensity</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The intensity of the light received from the sensor, linear in the voltage provided by the light sensor.