Artificial Horizon display using a gyro

bodmer:
If you want to display just "roll" angle, i.e. pitch angle is zero then:

Use trigonometry (Tan) to find the coordinates of the point at the edge of the screen of a line at the angle you want which passes through the middle of the screen. Since the middle of the screen is a known point this is easy.

Then reflect the coordinate to get the point at the opposite edge. Now you have two points and you can draw two filled triangles and two filled rectangles to set the above and below horizon colours, then draw a line at the horizon.

If you want to add pitch then calculate the coordinate shift on the y axis and the use this as the point that the angled line passes though and to get the intersection coordinates at the edges of the screen. You cannot use coordinate reflection is this case. so you must use trig to get the 2 end points of the horizon line.

If you draw it out on paper you will see what I mean.

When you have debugged your code on the Adafruit library and are using an AVR processor (e.g. UNO, Mega etc) and do not achieve the refresh rate you want... then try my library here library here which is 3 to 10 times faster for graphics operations. I think you could achieve at least 5 frames per second. For a simpler display with a single line for a horizon you should be able to get at least 50 frames per second.

tried your library, but for some reason your examples dont display anything on the screen?