Jump to content

Component: Infrared (EBM020) (EBM Modules): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 48: Line 48:


''<span style="color:red;">No additional examples</span>''
''<span style="color:red;">No additional examples</span>''




Line 53: Line 55:
==Macro reference==
==Macro reference==


===SetTxOff===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 66: Line 69:




===SetTxOn===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 79: Line 83:




===GetDistanceValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 97: Line 102:




===GetADCValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 110: Line 116:




===Initialise===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-

Revision as of 11:49, 3 February 2023

Author Matrix TSL
Version 1.0
Category EBM Modules


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

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples



Macro reference

SetTxOff

SetTxOff
Turns off the IR Transmitter 
- VOID Return


SetTxOn

SetTxOn
Turns on the IR Transmitter 
- VOID Return


GetDistanceValue

GetDistanceValue
Returns the calculated distance for the given ADC reading 
- BYTE adc
 
- UINT Return


GetADCValue

GetADCValue
Gets the raw ADC input value for the IR receiver 
- BYTE Return


Initialise

Initialise
Initialise the component by loading the default calibration table 
- VOID Return



Property reference

Properties
Input ADC Channel
Analog input channel for the IR receiver 
Output Enable Pin
Pin used to control the IR Transmitter 
Initial/ Hardware Calibration Table
Point 1 ADC Value
The ADC value that would give the Point 1 Distance. If the ADC value is 0 the point is ignored.  
Point 1 Distance (mm)
The distance returned for an ADC reading given by Point 1 ADC value 
Point 2 ADC Value
 
Point 2 Distance (mm)
 
Point 3 ADC Value
 
Point 3 Distance (mm)
 
Point 4 ADC Value
 
Point 4 Distance (mm)