How to make a compass like the app in iphone. The 'n' 'e' 's' 'w' are always keep upright

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

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

What LVGL version are you using?

V8

What do you want to achieve?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Please add a screenshot about the compass you have imagined.
(I’m an Android user so I don’t how it looks like in iOS)

@


You can see the two pictures. The angle is different, but the charactors ‘东’ ‘南’ ‘西’ ‘北’ are always keep upright.

I think the simplest would be to use an image and rotate it. The letters can be separate objects positioned manually.

Thanks for reply,
I think it is difficult to rotate a picture with two positions at the same time. One position is the center of the background , the other one is the center of itself. And the center of itself is always moving.

How does it look like in the practice? A video instead of a screenshot would help me to understand it better.

I made a short video but can’t upload it. I haven’t been on the Forum very long. Any suggestions for uploading the video?

其实很简单啦,代表方向的那几个字你可以根据旋转的角度,然后确定位置再打印就可以了,外面的表盘可以用图片,也可以使用仪表部件。

I couldn’t find any video upload related restriction in the settings. What error do you get?


When I tried to upload a video.mov

Ah I see. I’m affraid if I enabled videos a lot of disk space will be occupied by them. Please upload the video to YouTube and embed it here.

I’ve made some similar, I use a image and rotate it with compass data

https://youtube.com/shorts/agKS0SQCdkk

https://youtube.com/shorts/fejm_BF8h4E

Very short video of iPhone compass

Great Idea, are you using SquareLine Studio or LVGL and Ardunio.

Here is our, Mike Morrow and myself, attempt to make a GPS using LilyGO T4 S3 AMOLED board/display. We are using SLS and Mike’s Ardunio ino code. It’s a slow learning process.

1 Like

I’m using LVGL and Platformio with arduino framework, I don’t use SquareLine Studio , all is “manual”

Does your GPS have a compass built into it? Ours is just a simple GPS.

Have compass with HMC5883 Module , GPS, Temperature and pressure, …
It’s still under development (it’s a hobby)

1 Like



@jgauchia I like your Compass better. Is that done with LVGL? Using Meter?

Would like to add that to my display, if it’s possible.

It’s an image in LVGL, later rotate It with Compass reading.

In my case the image is stored in an array,