Difference between revisions of "Component: Photo Reflector (Sensors)"
(XML import) |
|||
Line 21: | Line 21: | ||
==Examples== | ==Examples== | ||
− | + | ||
+ | Basic example which moves a object on the simulation panel and provides the analogue proximity reading based on the distance from the object from the sensor. | ||
+ | |||
+ | {{Fcfile|PhotoReflectorDemo.fcfx|PhotoReflectorDemo}} | ||
Revision as of 09:34, 28 July 2016
Author | Matrix Ltd |
Version | 1.0 (Release) |
Category | Sensors |
Contents
Photo Reflector component
Uses InfraRed light to detect if an external object is near to the sensor. Returns a discrete analogue signal which can represent distance from the nearest object. Useful for applications like wall following, control based systems and robotics.
Examples
Basic example which moves a object on the simulation panel and provides the analogue proximity reading based on the distance from the object from the sensor.
Downloadable macro reference
SampleSensor
Samples the sensor and automatically controls the emitter pin if enabled.
Returns the analogue reading from the sensor pin.
Parameters
- This macro has no parameters
Return value
Initialise
Sets up the I/O to allow the sensor to operate.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Emitter Type
This property is of type Fixed list of ints and can be referenced with the variable name EmitterType.
Decides if the emitter needs to be switched on and off during sampling
Sense Pin
This property is of type Single analog pin and can be referenced with the variable name SensePin.
Pin connected to the sensor element of the photo transistor
Discrete Distance
This property is of type Floating point and can be referenced with the variable name DiscreteDistance.
Simulation range used to determine if the sense pin is active or not.