Tilt function with LSM6DS3 not showing the right values

jremingston,
thanks for notifying me.
I have made modifications,
please take a look