2017년 7월 6일 목요일

Arduino101ProximitySensor


The Arduino 101 Proximity Sensor lets users receive data from a infrared proximity sensor. Note that the signal wire on the Grove header may be off by one pin. If you are not receiving any reading from the sensor, you may need to increase the pin number by one (A0 becomes A1) to read the correct pin. The Arduino sketch transforms the raw reading from the sensor into a distance in centimeters based on the spec sheet published by Sharp.
More Links
⦁ Download a sample project for the Arduino 101 Proximity Sensor.
⦁ View the how to instructions for the Arduino 101 Proximity Sensor.
⦁ View the hardware data sheet.

Properties

⦁ BluetoothDevice – The BluetoothLE component with a connection to the Arduino 101.

get Arduino101ProximitySensor1 BluetoothDevice
set Arduino101ProximitySensor1 BluetoothDevice  to
⦁ Pin – The Pin on the Arduino board that the device is wired in to.
get Arduino101ProximitySensor1 Pin
set Arduino101ProximitySensor1 Pin  to

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.

call Arduino101ProximitySensor1 IsSupported
⦁ ReadProximity – Obtain the most recent reading from the proximity sensor as reported by the Arduino. On success, the ProximityReceived event will be run.
call Arduino101ProximitySensor1 ReadProximity
⦁ RequestProximityUpdates – Request notification of updates for the proximity sensor attached to the Arduino 101. The ProximityReceived event will be run as proximity sensor readings are received from the Arduino.
call Arduino101ProximitySensor1 RequestProximityUpdates
⦁ StopProximityUpdates – Stop listening for notifications of proximity sensor readings from the Arduino. This only has an effect if there was a previous call to RequestProximityUpdates. There may be additional pending messages that will be processed after this call.
call Arduino101ProximitySensor1 StopProximityUpdates

Events

⦁ ProximityReceived – The event is run when a proximity measurement is received from the proximity sensor attached to the Arduino 101.

   Parameters:
   ⚬ proximity (number) — The proximity of an object from the sensor. Due to physical and mathematical limitations, this value will range from 6 to 80 cm.

when Arduino101ProximitySensor1 ProximityReceived proximity do



댓글 없음:

댓글 쓰기