Difference between revisions of "Component: Infrared (EBM020) (EBM Modules)"
(XML import - Pre 8.0 release) |
|||
Line 22: | Line 22: | ||
==Examples== | ==Examples== | ||
− | + | ||
+ | Sample program using the EBM020 - Infrared sensor. | ||
+ | |||
+ | Transmits a signal and determines distance from reflected value | ||
+ | |||
+ | {{Fcfile|EBM020 - Test Program.fcfx|EBM020 Example}} | ||
Revision as of 10:03, 22 October 2018
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | EBM Modules |
Contents
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
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
GetADCValue
Gets the raw ADC input value for the IR receiver
Parameters
- This macro has no parameters
Return value
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