Jump to content

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

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(10 intermediate revisions by 2 users not shown)
Line 22: Line 22:


==Detailed description==
==Detailed description==




Line 43: Line 45:




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


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''<span style="color:red;">No additional examples</span>''
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
|-
| colspan="2" | Turns off the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
|-
| colspan="2" | Turns on the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
|-
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | adc
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
|-
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}








==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
==Macro reference==
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Input ADC Channel
|-
| colspan="2" | Analog input channel for the IR receiver&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Output Enable Pin
|-
| colspan="2" | Pin used to control the IR Transmitter&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Initial/ Hardware Calibration Table
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 ADC Value
|-
| colspan="2" | The ADC value that would give the Point 1 Distance. If the ADC value is 0 the point is ignored. &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 Distance (mm)
|-
| colspan="2" | The distance returned for an ADC reading given by Point 1 ADC value&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 Distance (mm)
|-
| colspan="2" | &nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
|-
| colspan="2" | Turns off the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


 
===GetADCValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
| width="90%" class="mtx-class-macrohead" | '''GetADCValue'''
|-
| colspan="2" | Turns on the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
|-
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | adc
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
|-
|-
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
Line 239: Line 75:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetDistanceValue===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Input ADC Channel
|-
| colspan="2" | Analog input channel for the IR receiver&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Output Enable Pin
|-
| colspan="2" | Pin used to control the IR Transmitter&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Initial/ Hardware Calibration Table
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 ADC Value
|-
| colspan="2" | The ADC value that would give the Point 1 Distance. If the ADC value is 0 the point is ignored. &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 Distance (mm)
|-
| colspan="2" | The distance returned for an ADC reading given by Point 1 ADC value&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 Distance (mm)
|-
| colspan="2" | &nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
|-
| colspan="2" | Turns off the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
|-
| colspan="2" | Turns on the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
| width="90%" class="mtx-class-macrohead" | '''GetDistanceValue'''
|-
|-
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
Line 361: Line 94:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
|-
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
Line 387: Line 108:




 
===SetTxOff===
 
{| class="mtx-class-macrotable wikitable"
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| width="90%" | Input ADC Channel
|-
| colspan="2" | Analog input channel for the IR receiver&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Output Enable Pin
|-
| colspan="2" | Pin used to control the IR Transmitter&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Initial/ Hardware Calibration Table
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 ADC Value
|-
| colspan="2" | The ADC value that would give the Point 1 Distance. If the ADC value is 0 the point is ignored. &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 1 Distance (mm)
|-
| colspan="2" | The distance returned for an ADC reading given by Point 1 ADC value&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 2 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 3 Distance (mm)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 ADC Value
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Point 4 Distance (mm)
|-
| colspan="2" | &nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
| width="90%" class="mtx-class-macrohead" | '''SetTxOff'''
|-
|-
| colspan="2" | Turns off the IR Transmitter&nbsp;
| colspan="2" | Turns off the IR Transmitter&nbsp;
Line 465: Line 122:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetTxOn===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
| width="90%" class="mtx-class-macrohead" | '''SetTxOn'''
|-
|-
| colspan="2" | Turns on the IR Transmitter&nbsp;
| colspan="2" | Turns on the IR Transmitter&nbsp;
Line 476: Line 134:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
|-
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | adc
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
|-
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 542: Line 154:
| colspan="2" | Pin used to control the IR Transmitter&nbsp;
| colspan="2" | Pin used to control the IR Transmitter&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Initial/ Hardware Calibration Table
| width="90%" class="mtx-class-propfolder" | Initial/ Hardware Calibration Table
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

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

GetADCValue

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


GetDistanceValue

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


Initialise

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


SetTxOff

SetTxOff
Turns off the IR Transmitter 
- VOID Return


SetTxOn

SetTxOn
Turns on the IR Transmitter 
- 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)