Difference between revisions of "Component: Range Time of Flight (VL53L0X) (Light)"

From Flowcode Help
Jump to navigationJump to search
(11 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
A laser based range sensor designed to provide accurate range infomation for a very narrow sensing beam. Capable of sensing ranges from 50mm to 1200mm. Communication with the device is based on a I2C bus.
 
A laser based range sensor designed to provide accurate range infomation for a very narrow sensing beam. Capable of sensing ranges from 50mm to 1200mm. Communication with the device is based on a I2C bus.
  
==Component Pack==
+
==Component Source Code==
  
FREE
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_RangeTOF_VL53L0X.fcfx FC_Comp_Source_RangeTOF_VL53L0X.fcfx]
 +
 
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RangeTOF_VL53L0X.fcfx FC_Comp_Source_RangeTOF_VL53L0X.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 32: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 45: Line 75:
 
{{Fcfile|Detector.fcfx|Detector}}
 
{{Fcfile|Detector.fcfx|Detector}}
  
==Downloadable macro reference==
 
  
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===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;" | '''ReadModel'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" |  
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
===ReadDistance===
 +
{| 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;" | '''ReadDistance'''
 
|-
 
|-
| colspan="2" | Collects the model number from the sensor 
+
| colspan="2" | Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
 
|-
 
|-
 
|-
 
|-
| 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-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadModel===
 
{| 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;" | '''ReadRevision'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadModel'''
 
|-
 
|-
| colspan="2" | Collects the revision number from the sensor 
+
| colspan="2" | Collects the model number from the sensor 
 
|-
 
|-
 
|-
 
|-
Line 73: Line 131:
  
  
 +
===ReadRegister===
 
{| 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;" | '''ReadDistance'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRegister'''
 +
|-
 +
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
 +
|-
 
|-
 
|-
| colspan="2" | Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 
|-
 
|-
 +
| colspan="2" |  
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
+
| 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''
 
|}
 
|}
  
  
 +
===ReadRegister16===
 
{| 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;" | '''ReadRegister'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRegister16'''
 
|-
 
|-
 
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
 
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
Line 98: Line 163:
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
===ReadRevision===
 +
{| 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;" | '''ReadRevision'''
 +
|-
 +
| colspan="2" | Collects the revision number from the sensor 
 +
|-
 
|-
 
|-
 
| 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-u8-icon.png]] - BYTE
Line 104: Line 183:
  
  
 +
===WriteRegister===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 127: Line 207:
  
  
 +
===WriteRegister16===
 
{| 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;" | '''WriteRegister16'''
 +
|-
 +
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" |  
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
+
| 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''
 
|}
 
|}
 
 
  
  
Line 150: Line 239:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Range
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Properties
 
|-
 
|-
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 185: Line 273:
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Scope Traces
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
 
| colspan="2" | Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Console Data
 
|-
 
| colspan="2" | Selects if the console data is automatically generated or not 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Injector
 
|-
 
| colspan="2" | Specifies the injector component on the panel to interact with to provide comms simulation. 
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
 
|-
 
|-
 
|-
 
|-

Revision as of 11:57, 3 November 2023

Author MatrixTSL
Version 1.0
Category Light


Range Time of Flight (VL53L0X) component

A laser based range sensor designed to provide accurate range infomation for a very narrow sensing beam. Capable of sensing ranges from 50mm to 1200mm. Communication with the device is based on a I2C bus.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

Simple example showing the proximity detector component at work, when a proximity is detected the direction of the motor is reversed. FC6 Icon.png Detector







Macro reference

Initialise

Fc9-comp-macro.png Initialise
 
Fc9-bool-icon.png - BOOL Return


ReadDistance

Fc9-comp-macro.png ReadDistance
Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
Fc9-s16-icon.png - INT Return


ReadModel

Fc9-comp-macro.png ReadModel
Collects the model number from the sensor 
Fc9-u8-icon.png - BYTE Return


ReadRegister

Fc9-comp-macro.png ReadRegister
A simple example showing a generic way to read a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Return


ReadRegister16

Fc9-comp-macro.png ReadRegister16
A simple example showing a generic way to read a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u16-icon.png - UINT Return


ReadRevision

Fc9-comp-macro.png ReadRevision
Collects the revision number from the sensor 
Fc9-u8-icon.png - BYTE Return


WriteRegister

Fc9-comp-macro.png WriteRegister
A simple example showing a generic way to write a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


WriteRegister16

Fc9-comp-macro.png WriteRegister16
A simple example showing a generic way to write a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u16-icon.png - UINT Data
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I2C Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms