Jump to content

Component: Photo Transistor (Light)

From Flowcode Help
Revision as of 14:23, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"")
Author Matrix Ltd
Version 1.0
Category Light


Photo Transistor component

Uses InfraRed light to detect if an external object is near to the sensor. Returns a digital signal which can represent detected or not detected states. Useful for applications like line following, punched card based data systems and robotics.

Detailed description

No detailed description exists yet for this component

Examples

A basic example which moves an object on the panel. When the object is in range of the sensor the sensor output goes high, otherwise the sensor output goes low. PhotoTransistorDemo






Macro reference

Initialise

Initialise
Configures the I/O ready for the sensor to be sampled. 
- VOID Return


SampleSensor

SampleSensor
Samples the sensor and automatically controls the emitter pin if enabled. Returns the state of 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
Sensor Range
Simulation range used to determine if the sense pin is active or not. 

Component Source Code

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

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