Lidar Lite - I2C setup

62 views
Skip to first unread message

Gabor Schilten

unread,
Jun 5, 2015, 3:47:45 PM6/5/15
to ioio-...@googlegroups.com
Hi,

I am trying to get a Lidar Lite working via the IOIO OTG board, using I2C.
However, I'm not the most experienced I2C developer, and can;t get the device to work.

Has anyone here been playing with the same/different I2C based laser distance sensor?

Thanks,

Gabor

Ytai Ben-Tsvi

unread,
Jun 6, 2015, 1:52:37 AM6/6/15
to ioio-...@googlegroups.com
I2C is easy. Once you have implemented two near trivial methods, namely:
byte readRegister(byte regnum)
and 
void writeRegister(byte regnum, byte value)
You can forget about I2C and start talking to the chip according to the information provided in http://kb.pulsedlight3d.com/support/solutions/articles/5000549537-control-registers and related documentation on that site.

Alternatively, this sensor seems to support a different mode, where it is emitting PWM with bandwidth proportional to distance, so you can use this mode as well with PulseInput.


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Gabor Schilten

unread,
Jun 7, 2015, 7:35:37 AM6/7/15
to ioio-...@googlegroups.com

Hi,

With your advice I got something working!
(Compete i2c noob here)

Distance works up to 80 cm or so, after that I get negative values. Any suggestions?

Best regards,

Gabor

Ytai Ben-Tsvi

unread,
Jun 7, 2015, 10:08:22 PM6/7/15
to ioio-...@googlegroups.com

My bet would be that you have a bug related to java bytes being signed.
To get a value between 0-255 from a byte type, use (value & 0xff)

Gabor Schilten

unread,
Jun 15, 2015, 1:16:25 AM6/15/15
to ioio-...@googlegroups.com

Hi,

Got it working!
2 bytes to an int was the final trick.
Will try to document my project some time. But the first goal is to have an autonomous car pick up visitors in my office.
Thanks for the support!

Best regards,
Gabor

IMG_20150615_071529.jpg
IMG_20150615_071540.jpg

Andrew Robinson

unread,
Jun 17, 2015, 5:01:49 PM6/17/15
to ioio-...@googlegroups.com
Nice - can you rotate the nexus phone 180 degrees- I see you have some lego gears underneath there for something.....

Gabor Schilten

unread,
Jun 17, 2015, 5:43:56 PM6/17/15
to ioio-...@googlegroups.com

Yeah, actually more than that, a bit imprecise but around 600 degrees ;)
Will be used to look around when remotely accessing the camera.

Reply all
Reply to author
Forward
0 new messages