3009 views|5 replies

2549

Posts

0

Resources
The OP
 

【Top Micro Intelligent Display Module】IV: Serial port interaction and application of curve, drawing board and animation controls [Copy link]

This post was last edited by Digital Leaf on 2021-11-21 12:00

In the previous article, SGTools was used to generate a simple interface, so it is easy to use SGTools, and you don’t even need to read any information. However, there are still some complex operations that require the combination of SGTools and command formats.

The first thing to do is to interact with the screen using the serial port. As mentioned before, because it is a standard 232 interface, a USB to 232 cable is required.

Then use Dupont wire to connect the 232 line and the screen.

In the installation directory of SGTools, there is a serial port tool TOPWAY SGTools Command Tools. With this tool, you can find many specific communication protocols.

Of course, you can also use custom instructions to get familiar with related operations, and custom instructions are also suitable for some complex situations that are not defined by the software. Customization is equivalent to an ordinary serial port.

After connecting the screen and turning on the power supply, it is connected

It is very simple to change some strings in real time, display values, etc. You can just operate it directly. If the display is wrong, you can read it back and have a look. I have experienced it many times and found that most of the failures are caused by the failure of data to be sent successfully.

In the SGTools control, there are two operations: curve and drawing board. At first, I didn't understand the difference between them, so I used them interchangeably and took some detours. But later I understood them more thoroughly. The curve control can display curve variables. When the content in the curve variable array is updated, the related curve will be updated in real time on the screen. The screen supports 5 types of curves: point, line, bottom fill, top fill, and area fill.

The curve control needs to be used in conjunction with the curve variable. This is what I made a mistake at the beginning.

This width is multiplied by the point width in the attribute, which I discovered after drawing it several times.

Finally, you can use the drawing command to draw the curve.

The reason why curves and drawing boards are easily confused is that drawing boards are similar to curves. After understanding them, you will find that the way data is filled is different, and the drawing board can draw more types of drawings, not just curves.

First, use the drawing board control to drag out an area where you can draw.

The rest depends on the serial port transmission instructions

Then I thought about the whole complex, and then I thought of the five-pointed star, and then I calculated the coordinates of the five-pointed star for a long time... (a lot of brain cells died), and then converted it into hexadecimal, and then combined it into a serial port command

Fortunately, the five-pointed star was finally drawn

Drawing effect:


Finally, there is the animation control, which is quite interesting. It can display a small animation on some pages to increase the fun of the page content.

Animation not only needs to create an animation range, but also needs to build animation on the left first to configure the animation

In the property page, you can upload resources, further edit them, and preview the final effect (finally there is a control that supports previewing effects )

Animation effects:


SGTools builds a framework, draws the display area of the specified control, and then operates through instructions to be responsible for the specific content. Therefore, it can be found that there is still a lot of room for upgrading SGTools. Some display content, coordinates and so on can be defined synchronously. This way of coexisting with instructions simplifies the initial design and facilitates subsequent changes.

This post is from Test/Measurement

Latest reply

How fast is the bar graph?   Details Published on 2021-11-23 10:24
 
 

6555

Posts

0

Resources
2
 

Use custom commands to a normal serial port

And use the serial port method, use the Dupont line 232 line and the screen through the serial port tool software

The latter should be simple as

This post is from Test/Measurement

Comments

Feeling each has its own advantages  Details Published on 2021-11-21 21:07
 
 
 

2549

Posts

0

Resources
3
 
Jacktang posted on 2021-11-21 20:55 Use custom instructions to connect a normal serial port and use the serial port method, use Dupont line 232 line and the screen through the serial port tool software. The latter should be simple as if...

Feeling each has its own advantages

This post is from Test/Measurement
 
 
 

5213

Posts

239

Resources
4
 

Twinkle, Twinkle Little Star

This post is from Test/Measurement
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
 
 

6742

Posts

2

Resources
5
 

How fast is the bar graph?

This post is from Test/Measurement

Comments

A moment  Details Published on 2021-11-23 20:53
 
 
 

2549

Posts

0

Resources
6
 
wangerxian posted on 2021-11-23 10:24 How fast is the bar chart?

A moment

This post is from Test/Measurement
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list