rotating graphics on SSD1306


I have no code yet for this project as I am struggle with where to start.

Basically I would like to move a pointer round the the display in a circle (see attachement for illustation).

I know I can create a 1xN array to the graphic but how to then rotate the pointer around is beyond me

I would like the code to be as flexible as possible and was considering using a rotation matrix but how should I apply it to the graphics array efficiently?

any suggestions and/or sample code would be much appreciated.


How do you draw the triangle now? I would expect that you know where the center of the circle is, and the radius of the arc that the tip points to, That defines one of the three points. The height and width of the triangle define the other two points. If you are using a library to draw the triangle, and it can fill the triangle for you, you are home free. The radius and angle to each point can be computed, and passed to a function to convert polar coordinates to cartesian coordinates. Adding a delta to the angle means that the converted coordinates will draw the triangle in a different place.

Thank you for your reply PaulS

If I may ask could you please share the libraries I should use to achieve this?

I was thinking of rotating a custom character but if it is possible to actually draw the pointer out that would definitely be much easier! :slight_smile: