Component: Infrared (EBM020) (EBM Modules)

From Flowcode Help
Revision as of 10:03, 22 October 2018 by BenR (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category EBM Modules


Image Infrared (EBM020) component

The Infrared sensor board contains both an IR transmitter and receiver. The transmitter is enabled via a digital control signal and the receiver provides an analogue output. By enabling the transmitter and reading the variable voltage output of the receiver it is possible to measure the distance of a reflecting object in the region of 1cm to 10cm.

Examples

Sample program using the EBM020 - Infrared sensor.

Transmits a signal and determines distance from reflected value

FC6 Icon.png EBM020 Example


Downloadable macro reference

SetTxOff

Turns off the IR Transmitter

Parameters

This macro has no parameters


Return value

This call does not return a value


SetTxOn

Turns on the IR Transmitter

Parameters

This macro has no parameters


Return value

This call does not return a value


GetDistanceValue

Returns the calculated distance for the given ADC reading

Parameters

BYTE adc


Return value

UINT


GetADCValue

Gets the raw ADC input value for the IR receiver

Parameters

This macro has no parameters


Return value

BYTE


Initialise

Initialise the component by loading the default calibration table

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

Input ADC Channel

This property is of type Single analog pin and can be referenced with the variable name CHANNEL.

Analog input channel for the IR receiver

Output Enable Pin

This property is of type Single digital pin and can be referenced with the variable name CONTROL.

Pin used to control the IR Transmitter

Point 1 ADC Value

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

The ADC value that would give the Point 1 Distance.

If the ADC value is 0 the point is ignored.

Point 1 Distance (mm)

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

The distance returned for an ADC reading given by Point 1 ADC value

Point 2 ADC Value

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

No additional information


Point 2 Distance (mm)

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

No additional information


Point 3 ADC Value

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

No additional information


Point 3 Distance (mm)

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

No additional information


Point 4 ADC Value

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

No additional information


Point 4 Distance (mm)

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

No additional information