c++

Arduino Nano IoT accelerometer data to pitch and roll

#blog #howto #arduino #arduino nano #accelerometer #c++ #electronics #programming #iot #microcontroller

The Arduino Nano 33 IoT comes with a built-in 3-axis acceleromteter. This sensor meassures values for x, y and z acceleration between -1 and 1. If we want to know the actual position in which the sensor is, we need to know it’s rotation on two axis, pitch and roll, in dregress. This two angles could be used then later on to control two servos which rotate an object exactly the same way the sensor is rotated.