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

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBM020v1.fcfx FC_Comp_Source_EBM020v1.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/EBM020v1.fcfx FC_Comp_Source_temp/EBM020v1.fcfx]
  
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM020v1.fcfx FC_Comp_Source_EBM020v1.fcfx]
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/EBM020v1.fcfx FC_Comp_Source_temp/EBM020v1.fcfx]
  
 
==Detailed description==
 
==Detailed description==
Line 48: Line 48:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
  
  
Line 55: Line 57:
 
==Macro reference==
 
==Macro reference==
  
===SetTxOff===
+
===GetADCValue===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
 
|-
 
|-
| colspan="2" | Turns off the IR Transmitter&nbsp;
+
| 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-void-icon.png]] - VOID
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===SetTxOn===
+
===GetDistanceValue===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
 +
|-
 +
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
 +
|-
 
|-
 
|-
| colspan="2" | Turns on the IR Transmitter&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-void-icon.png]] - VOID
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===GetDistanceValue===
+
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDistanceValue'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Returns the calculated distance for the given ADC reading&nbsp;
+
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===GetADCValue===
+
===SetTxOff===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetADCValue'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOff'''
 
|-
 
|-
| colspan="2" | Gets the raw ADC input value for the IR receiver&nbsp;
+
| colspan="2" | Turns off the IR Transmitter&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===Initialise===
+
===SetTxOn===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxOn'''
 
|-
 
|-
| colspan="2" | Initialise the component by loading the default calibration table&nbsp;
+
| colspan="2" | Turns on the IR Transmitter&nbsp;
 
|-
 
|-
 
|-
 
|-

Revision as of 12:00, 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_temp/EBM020v1.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/EBM020v1.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples




Macro reference

GetADCValue

Fc9-comp-macro.png GetADCValue
Gets the raw ADC input value for the IR receiver 
Fc9-u8-icon.png - BYTE Return


GetDistanceValue

Fc9-comp-macro.png GetDistanceValue
Returns the calculated distance for the given ADC reading 
Fc9-u8-icon.png - BYTE adc
 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the component by loading the default calibration table 
Fc9-void-icon.png - VOID Return


SetTxOff

Fc9-comp-macro.png SetTxOff
Turns off the IR Transmitter 
Fc9-void-icon.png - VOID Return


SetTxOn

Fc9-comp-macro.png SetTxOn
Turns on the IR Transmitter 
Fc9-void-icon.png - VOID Return



Property reference

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