Hi guys, Im using the above laser sensor to detect distance, it is a distance settable sensor. The laser sensor itself has 4 wires, where 2 of them need to be connected to external power source(in this case i use 15V) and another 2 I connected them to arduino. So I managed to get the reading(in mm), but the weird thing is, I'm getting random numbers. I attached 2 images (my code and its readings). Appreciate any help. thanks!

Please read this, it will give you a rundown on how to properly use the forums. Posting a picture of code is useless.
Can you also please provide a schematic of your circuit?
issacchook:
So I managed to get the reading(in mm), but the weird thing is, I'm getting random numbers.
From my 5 seconds of looking up a OMRON E3Z-LS63 is a Distance-settable Photoelectric Sensor.
Where are you getting laser and rangefinder expectations from?
Hi,
That sensor does not provide a variable output to represent distance sensed.
It works with the sensor being programmed with a preset distance.
Its logic output then changes when it senses the distance it is measuring crossing the programmed distance.
Tom... 