Bi-Directional Arc


I want to create an ARC that has a 0 point at 9 o’clock and when fed with a positive number starts moving clockwise.
When the arc is fed with a negative number, it will move from 9 o’clock counter clockwise

Can this be done?

What MCU/Processor/Board and compiler are you using?

Teensy 4.1

What LVGL version are you using?


What have you tried so far?

I tired using LV_ARC_TYPE_SYMMETRIC but that seems to mirror the arc lines from a middle point outwards.
I was thinking I might have to create two arc objects at the same coordinets, make one normal and one reverse - but if this can be done in one Arc is would make the code a bit easier to manage

I tried to make this work in the simulator. The arc seems to be really designed to draw in one direction only, even though it can accept negative values. It’s probably best to just use two arcs.

Okay, thanks for confirming!
When I set it to reveres, the entire rotation point etc is from the opposite direction, correct?

Also, is it possible to draw a rounded line on one side of the arc?

@embeddedt I suspect there might be a bug when setting the arc to Reverse.
Setting angles and range does very weird things.
Can you try make your reverse arc start at 9 o’clock and end at 6 o’clock with a range of 0-250?

Either the description of a reverse arc in the documentation is incorrect, or I’m interpreting it wrongly.

It seems that setting the arc to REVERSE does not change the rotation direction; it instead inverts what part of the arc is being drawn. You can see by changing it to NORMAL that the previously gray section of the arc is now aquamarine.

Here are the settings I am trying right now (may take up to 10 seconds to load).

@kisvegabor Could you please explain how these arc settings are supposed to work?

Okay - I see what it does now - it inverts the BG and the INDIC - I don’t see the sense in that, as you can just rotate it do do that and change the angles.

Documentation says “indicator arc drawn counter clockwise (max to current)”, so I would expect the arc to be drawn as described

1 Like

I agree; let’s wait for @kisvegabor to comment as he designed this API.

1 Like

This might help clear things up.