Log in

View Full Version : Program LIDAR for PWM Java


Merfoo
19-01-2015, 16:59
We are trying to use the LIDAR sensor via PWM. How would we program this using Java? Right now we are trying to time the pulse length of the DigitalInput (would be PulseIn in Arduino), how would we accomplish this?

eddie12390
19-01-2015, 17:10
Can you link to a datasheet for the sensor?

Merfoo
19-01-2015, 17:17
Can you link to a datasheet for the sensor?

http://pulsedlight3d.net/assets.pl3d/LIDAR-Lite-Operating-Manual.pdf

less in depth:
http://pulsedlight3d.net/assets.pl3d/LIDAR-Lite-Data-Sheet.pdf

eddie12390
20-01-2015, 12:34
Just so you know, there's an example code written by a ChiefDelphi user in Java (although it uses I2C).

https://gist.github.com/tech2077/c4ba2d344bdfcddd48d2

I wasn't able to find the equivalent function to pulseIn.

Joe Ross
21-01-2015, 11:53
We are trying to use the LIDAR sensor via PWM. How would we program this using Java? Right now we are trying to time the pulse length of the DigitalInput (would be PulseIn in Arduino), how would we accomplish this?

The Semi-Period mode of the counter class should do this. http://wpilib.screenstepslive.com/s/4485/m/13809/l/241874-counters-measuring-rotation-counting-pulses-and-more