How To Communicate With The Lw20 Using A Controller - Lightware LW20 Product Manual

Lidar sensor
Hide thumbs Also See for LW20:
Table of Contents

Advertisement

7. How to communicate with the LW20 using a controller

The LW20 is designed to communicate with a host controller. This controller can be a single board computer, flight controller or a PC.
There are two communications interfaces available, serial or I2C. The LW20/SER ships with a serial connection cable, the LW20/I2C
with an I2C cable and the SF20 with both serial and I2C cables. It is possible to change the LW20 interface later by returning your
unit to a certified service agent.
The serial port is a one-to-one protocol that lets a single LW20 talk to a single host controller. The serial interface uses 3.3 V logic to
transmit results and receive commands. 5 V logic should also work without any level shifters.
Multiple LW20's with an I2C port can be connected onto an I2C bus. The I2C interface uses 3.3 V logic to receive commands from a
master device. In some cases, 5 V logic will also work but this is not guaranteed.
The communication language for both the serial and I2C ports is based on ASCII commands and messages. Command strings take the
form of simple mnemonics and results are provided as text strings.
A command string is made up of:
A directive that indicates what action to take
A channel that represents a functional block containing related information
An index that determines which value is being acted on
A numeric value if needed
<CR><LF> indicates the end of the command
There are four different directives, each using a single ASCII character:
Fetch a value
=
?
Write a value
=
#
Stream live results
=
$
Save changes
=
%
There are six channels available inside the LW20:
The Product channel contains product related information
The Laser channel contains all laser related information
The Servo channel contains all servo related information
The Communication channel handles serial and I2C data
The Alarm channel provides alarm status information
The Energy channel controls power usage
A typical command sent by the host controller would be:
?PN<CR><LF>
Which means:
What is your Product Name?
The LW20 / SF20 would reply with:
PN:LW20 <CR><LF>
Which means:
Product Name : LW20
Full details of the communication language are given in Appendix C.
LW20 / SF20 LiDAR - Product manual - Revision 2
=
P
=
L
=
S
=
C
=
A
=
E
|
|
13
of
25
© LightWare Optoelectronics (Pty) Ltd, 2017
LW20 / SF20 LiDAR sensor
Product manual
|
www.lightware.co.za

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sf20

Table of Contents