Component: Photo Transistor (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.0 (Release)
Category Sensors


Image 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.

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. FC6 Icon.png PhotoTransistorDemo

Downloadable macro reference

SampleSensor

Samples the sensor and automatically controls the emitter pin if enabled.

Returns the state of the sensor pin.

Parameters

This macro has no parameters


Return value

BYTE


Initialise

Configures the I/O ready for the sensor to be sampled.

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 digital pin and can be referenced with the variable name SensePin.

Pin connected to the sensor element of the photo transistor

Sensor Range

This property is of type Unsigned integer and can be referenced with the variable name SensorRange.

Simulation range used to determine if the sense pin is active or not.