I'm working on project whose goal it to measure a distance thanks to an ultrasonic sensor (this part is already working).
However, my sensor is not always perpendicular to the surface I'm pointing at. To have the true value of the distance, I'd like to measure the angle of my sensor and take it into account with trigonometry.
I saw a few examples of programs to control a gyroscope, but they seem really complex, and use librairies such as Wire, I2C... Do you know if there is another way that is simple to know what the gyro is telling me? Using a analog input for instance?
I also need only 1 axis, that's why I'm looking for something very simple.
Thanks for your help!