GithubHelp home page GithubHelp logo

jhlidarlite_v2's People

Contributors

jetsonhacks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jhlidarlite_v2's Issues

L4T 32.2 compilation issue

Hi @jetsonhacks,
Thank you for the project. I confirm that your code is working with LidarLite V3 & Jetson Nano, with the following wiring map:

VCC J41-4 -> Lidar-Lite (+) 5V (red wire)
GND J41-6 -> Lidar-Lite (-)
SCL J41-5 -> Lidar-Lite (SCL)
SDA J41-3 -> Lidar-Lite (SDA)

Plus, to get code working with L4T 32.2 i have to do the following small changes, due to modifications in libi2c & libi2c-dev (4.0-2)

diff --git a/example/LidarPlotSketch/PlotPractice.pro b/example/LidarPlotSketch/PlotPractice.pro
index 8f14a6e..a7efeda 100644
--- a/example/LidarPlotSketch/PlotPractice.pro
+++ b/example/LidarPlotSketch/PlotPractice.pro
@@ -30,3 +30,5 @@ OTHER_FILES += \
 
 RESOURCES += \
     PlotPractice.qrc
+
+unix|win32: LIBS += -li2c
diff --git a/example/LidarPlotSketch/lidarlite.h b/example/LidarPlotSketch/lidarlite.h
index 79f6b79..4c359f9 100644
--- a/example/LidarPlotSketch/lidarlite.h
+++ b/example/LidarPlotSketch/lidarlite.h
@@ -25,7 +25,6 @@
 #define LIDARLITE_H
 
 #include <cstddef>
-#include <linux/i2c-dev.h>
 #include <sys/ioctl.h>
 #include <cstdlib>
 #include <cstdio>
@@ -33,6 +32,10 @@
 #include <unistd.h>
 #include <errno.h>
 
+extern "C" {
+    #include <i2c/smbus.h>
+    #include <linux/i2c-dev.h>
+}
 
 // Information taken from PulsedLight knowledge base 5-4-15
 // Internal Control Registers
diff --git a/example/Makefile b/example/Makefile
index d7d3f15..9cc68dd 100755
--- a/example/Makefile
+++ b/example/Makefile
@@ -1,2 +1,2 @@
 all:
-       g++ example.cpp ../src/lidarlite.cpp -I../src -o example
+       g++ example.cpp ../src/lidarlite.cpp -I../src -li2c -o example
diff --git a/src/lidarlite.h b/src/lidarlite.h
index 35343ff..c9289fc 100644
--- a/src/lidarlite.h
+++ b/src/lidarlite.h
@@ -26,7 +26,6 @@
 #define LIDARLITE_H
 
 #include <cstddef>
-#include <linux/i2c-dev.h>
 #include <sys/ioctl.h>
 #include <cstdlib>
 #include <cstdio>
@@ -34,6 +33,11 @@
 #include <unistd.h>
 #include <errno.h>
 
+extern "C" {
+    #include <linux/i2c-dev.h>
+    #include <i2c/smbus.h>
+}
+
 
 // Information taken from PulsedLight knowledge base 5-4-15
 // Internal Control Registers

Please let me know if you would like me to create PR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.