Jump to content

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

From Flowcode Help
No edit summary
No edit summary
Line 74: Line 74:
Simple example showing the proximity detector component at work, when a proximity is detected the direction of the motor is reversed.
Simple example showing the proximity detector component at work, when a proximity is detected the direction of the motor is reversed.
{{Fcfile|Detector.fcfx|Detector}}
{{Fcfile|Detector.fcfx|Detector}}




Line 125: Line 127:
|-
|-
| 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
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
===ReadRegister===
{| 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;" | '''ReadRegister'''
|-
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
|-
|-
| 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-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
===ReadRegister16===
{| 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;" | '''ReadRegister16'''
|-
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
|-
|-
| 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-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
Line 139: Line 179:
|-
|-
| 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
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
===WriteRegister===
{| 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;" | '''WriteRegister'''
|-
| 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" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" |  
|-
| 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''
|}
===WriteRegister16===
{| 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;" | '''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" |  
|-
| 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-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}

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







Macro reference

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
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) 
SCL
Pin used for SCL (clock signal) 
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