Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Distance Mask Incorrect? #5

franksmicro opened this Issue Apr 21, 2013 · 1 comment


None yet
2 participants

Thanks for the library. I bought a sensor and was using it yesterday. I believe however that there is an issue in returning the distance.

I think the mask for distance should be:

define AS3935_DISTANCE 0x07, 0x3F

instead of the present

define AS3935_DISTANCE 0x07, 0x1F

From the AS3935 spec sheet:
DISTANCE [5:0] R 000000 Distance estimation

The 1F mask only allows 5 bits instead of 6, so distances returned would always be less than 32km instead of the 63km range of the chip.

Let me know if I am correct about this.



raivisr commented Apr 21, 2013

Thank you, duly noted and fixed.

@raivisr raivisr closed this Apr 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment