hi everyone, i have hit a bit of snag with my project and would love a second opinion.
The project
i have staircase where i want to make each step make a sound when stepped on, unfortunately it's a concrete staircase so i can't use bending or weight sensors.
this is where the TFmini-s lidar comes in. this is a great little lidar that has a serial and a I2C mode. i tested it with the serial and it works great, but to save myself a lot of wiring i trying to read the distance through I2C with a 20x2 picaxe.
the problem
i successfully switched the TFmini-s to i2c mode and it shows up as 0x10 on a i2c scan, so i know it works and is able to send and receive data
but when i try to get any kind of data it just fills any requested byte with 1's
here is the code, i have been tweaking it in a attempt to get anything for it with no results
here is the data sheet of the lidar
https://cdn.sparkfun.com/assets/8/a/f/a/c/16977-TFMini-S_-_Micro_LiDAR_Module-Product_Manual.pdf
please let me know if you have any hints or spot any obvious mistakes
The project
i have staircase where i want to make each step make a sound when stepped on, unfortunately it's a concrete staircase so i can't use bending or weight sensors.
this is where the TFmini-s lidar comes in. this is a great little lidar that has a serial and a I2C mode. i tested it with the serial and it works great, but to save myself a lot of wiring i trying to read the distance through I2C with a 20x2 picaxe.
the problem
i successfully switched the TFmini-s to i2c mode and it shows up as 0x10 on a i2c scan, so i know it works and is able to send and receive data
but when i try to get any kind of data it just fills any requested byte with 1's
here is the code, i have been tweaking it in a attempt to get anything for it with no results
Code:
setfreq m8
hi2csetup i2cmaster, 0x10, i2cslow_8, i2cbyte ; set PICAXE as master
main:
hi2cin 0x01,(b0,b1,b2,b3,b4,b5,b6,b7) ; read data
debug
pause 500
goto main
https://cdn.sparkfun.com/assets/8/a/f/a/c/16977-TFMini-S_-_Micro_LiDAR_Module-Product_Manual.pdf
please let me know if you have any hints or spot any obvious mistakes