Jump to content

Component: Photo Reflector (Light): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
Line 65: Line 65:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Sets up the I/O to allow the sensor to operate. 
| colspan="2" | Sets up the I/O to allow the sensor to operate. 
Line 79: Line 79:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleSensor'''
| width="90%" class="mtx-class-macrohead" | '''SampleSensor'''
|-
|-
| colspan="2" | Samples the sensor and automatically controls the emitter pin if enabled. Returns the analogue reading from the sensor pin. 
| colspan="2" | Samples the sensor and automatically controls the emitter pin if enabled. Returns the analogue reading from the sensor pin. 
Line 94: Line 94:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Revision as of 14:23, 13 July 2026

Author Matrix Ltd
Version 1.0
Category Light


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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_PhotoReflector.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_PhotoReflector.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

Initialise

Initialise
Sets up the I/O to allow the sensor to operate. 
- VOID Return


SampleSensor

SampleSensor
Samples the sensor and automatically controls the emitter pin if enabled. Returns the analogue reading from the sensor pin. 
- BYTE Return


Property reference

Properties
Emitter Type
Decides if the emitter needs to be switched on and off during sampling 
Connections
Sense Pin
Pin connected to the sensor element of the photo transistor 
Simulation
Discrete Distance
Simulation range used to determine if the sense pin is active or not.