Herein lies code for estimating the orientation of a gyroscope and accelerometer using a Kalman filter. An Arduino sends the sensor measurements through a serial port to a Python program that implements the filter.