Jump to content

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

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(5 intermediate revisions by the same user not shown)
Line 68: Line 68:


===ChangeI2CAddress===
===ChangeI2CAddress===
{| 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;" | '''ChangeI2CAddress'''
| width="90%" class="mtx-class-macrohead" | '''ChangeI2CAddress'''
|-
|-
| colspan="2" | Updates the I2C address of the sensor. 
| colspan="2" | Updates the I2C address of the sensor. 
Line 92: Line 92:


===Initialise===
===Initialise===
{| 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;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 106: Line 106:


===ReadDistance===
===ReadDistance===
{| 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;" | '''ReadDistance'''
| width="90%" class="mtx-class-macrohead" | '''ReadDistance'''
|-
|-
| colspan="2" | Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
| colspan="2" | Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
Line 120: Line 120:


===ReadModel===
===ReadModel===
{| 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;" | '''ReadModel'''
| width="90%" class="mtx-class-macrohead" | '''ReadModel'''
|-
|-
| colspan="2" | Collects the model number from the sensor 
| colspan="2" | Collects the model number from the sensor 
Line 134: Line 134:


===ReadRegister===
===ReadRegister===
{| 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;" | '''ReadRegister'''
| width="90%" class="mtx-class-macrohead" | '''ReadRegister'''
|-
|-
| 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 153: Line 153:


===ReadRegister16===
===ReadRegister16===
{| 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;" | '''ReadRegister16'''
| width="90%" class="mtx-class-macrohead" | '''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 172: Line 172:


===ReadRevision===
===ReadRevision===
{| 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;" | '''ReadRevision'''
| width="90%" class="mtx-class-macrohead" | '''ReadRevision'''
|-
|-
| colspan="2" | Collects the revision number from the sensor 
| colspan="2" | Collects the revision number from the sensor 
Line 186: Line 186:


===WriteRegister===
===WriteRegister===
{| 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;" | '''WriteRegister'''
| width="90%" class="mtx-class-macrohead" | '''WriteRegister'''
|-
|-
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
Line 210: Line 210:


===WriteRegister16===
===WriteRegister16===
{| 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;" | '''WriteRegister16'''
| width="90%" class="mtx-class-macrohead" | '''WriteRegister16'''
|-
|-
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
Line 235: Line 235:
==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'''  
|-
|-
|-
|-
| 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;" | Sensor Properties
| width="90%" class="mtx-class-propfolder" | Sensor Properties
|-
|-
|-
|-
Line 250: Line 250:
| colspan="2" |  
| colspan="2" |  
|-
|-
| 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;" | I2C Properties
| width="90%" class="mtx-class-propfolder" | I2C Properties
|-
|-
|-
|-
Line 294: Line 294:
| 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" 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;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

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.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

ChangeI2CAddress

ChangeI2CAddress
Updates the I2C address of the sensor. 
- BYTE Address
 
- BOOL UpdateAddressReg
0=Leave address register alone, 1=Update address register 
- VOID Return


Initialise

Initialise
 
- BOOL Return


ReadDistance

ReadDistance
Read the current distance in mm. Returns -1 if the sensor timed out during the read operation. 
- INT Return


ReadModel

ReadModel
Collects the model number from the sensor 
- BYTE Return


ReadRegister

ReadRegister
A simple example showing a generic way to read a register using I2C. 
- BYTE Address
 
- BYTE Return


ReadRegister16

ReadRegister16
A simple example showing a generic way to read a register using I2C. 
- BYTE Address
 
- UINT Return


ReadRevision

ReadRevision
Collects the revision number from the sensor 
- BYTE Return


WriteRegister

WriteRegister
A simple example showing a generic way to write a register using I2C. 
- BYTE Address
 
- BYTE Data
 
- VOID Return


WriteRegister16

WriteRegister16
A simple example showing a generic way to write a register using I2C. 
- BYTE Address
 
- UINT Data
 
- VOID Return


Property reference

Properties
Sensor Properties
Range
 
I2C Properties
Channel
Channel selection 
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
SDA
Pin used for SDA (data signal) 
SDA Remap Pin
 
SCL
Pin used for SCL (clock signal) 
SCL Remap Pin
 
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.  
Simulation
Simulate Comms
 

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