1. Home
  2. Docs
  3. ATFC Touch Screen
  4. Command Handbook

Command Handbook

Contents

Drawing Commands

Command:

@PIX x,y\r

Meaning:

Draw a pixel dot at position (X, Y). X and Y are integers.

Example:

@PIX 10,20\r

Command:

@LINE xs,ys,xe,ye\r

Meaning:

Draw a line starting from (xs, ys) to (xe, ye), with the current "drawing painting color" and "drawing paint line width" value.

Example:

@LINE 10,10,100,100\r

Command:

@FILL xs,ys,xe,ye\r

Meaning:

Draw a solid rectangle that starts (xs, ys) as the top left corner and (xe, ye) as the bottom right corner, filling the rectangular area with the current drawing paint color.

Example:

@FILL 10,10,80,80\r

Command:

@REC xs,ys,xe,ye\r

Meaning:

Draw a rectangle frame that starts (xs, ys) as the top left corner and (xe, ye) as the bottom right corner, with the current drawing paint color and current drawing line width.

Example:

@REC 10,10,80,80\r

Command:

@CIRL xs,ys,ri\r

Meaning:

Draw a circle frame, With (xs, ys) as the center of the circle and ri as the radius, and using the current drawing paint color and current drawing line width.

Example:

@CIRL 90,90,30\r

Command:

@CIRF xs,ys,ri\r

Meaning:

Draw a solid circle, With (xs, ys) as the center of the circle and ri as the radius, and fill iwth the current drawing paint color.

Example:

@CIRF 90,90,30\r

Display Commands

Command:

@STR xs,ys,string\r

Meaning:

Display a string where the top left corner is (xs, ys) and with the current font library and font color.

Example:

@STR 20,30,https://clarkwise.cc\r

Command:

@BMP xs,ys,ResIndex\r

Meaning:

Display a picture (index=ResIndes) where the top left corner is (xs, ys).
It is not limited to BMP file. All the supported images can be used here.

Example:

@BMP 0,0,20\r

Command:

@CLR\r

Meaning:

Fill the current screen with drawing paint color.
If string direct printing mode is on, then this command will clear the printing area as well as the printing buffer.

Example:

@CLR\r

Command:

@FONT Index,Color\r

Meaning:

Setup the font library and font color for @STR command.

The font library could be internal fonts (Totally 4 available, they are 0x8000, 0x8001, 0x8002, 0x8003) or loaded font libraries (its resource index).

The Color can be set as a color name or the RBG565 color format. (Read More)

Example:

@FONT 0x8002,Red\r
@FONT 0x8002,0xf800\r
@FONT 24,White\r

Command:

@PMODE LineWidth,Color\r

Meaning:

Setup the drawing paint line width and drawing paint color.
The Color could be the keyword or the RGB565 format.

Example:

@PMODE 2,Yellow\r
@PMODE 2,0xffe0\r

Command:

@FMODE Mode,Color\r

Meaning:

Setup the string background color mode for @STR command.
Mode=1 to enable the background color. Mode=0 to disable it.
Color is color keyword or RGB565.

Example:

@FMODE 1,Green\r
@FMODE 1,0x07e0\r

Command:

@BKL LightLevel\r

Meaning:

Set the background light level to LightLevel. The possible range is 0-500. Set 0 to turn the screen black.

Example:

@BKL 300\r

Command:

@TIMERR\r

Meaning:

Read the system built-in RTC time. Returns the RTC time starts with @98 h/m/s\r. (24 hours)

Example:

@TIMERR\r

Return:

@98 13/5/9\r

Command:

@TIMERS h/m/s\r

Meaning:

Set the system built-in timer in 24 hours format.

Example:

@TIMERS 22/40/5\r

Command:

@DATER\r

Meaning:

Read the system built-in RTC date. Returns the RTC time starts with @99 Y/month/d\r. (24 hours)

Example:

@DATER\r

Return:

@99 2020/1/31\r

Command:

@DATES Year/month/day\r

Meaning:

Set the system built-in date in YYYY-m-d format.

Example:

@DATES 2020/1/31\r

Printing Commands

Command:

@PRINTM boolean\r

Meaning:

Turn on/off the direct printing mode. "boolean" could be 0 or 1. 0 means off, 1 means on.

Example:

@PRINTM 0\r

Command:

@PRFONT Index,Color\r

Meaning:

Setup the font library and font color for direct printing mode.

The font library could be internal fonts (Totally 4 available, they are 0x8000, 0x8001, 0x8002, 0x8003) or loaded font libraries (its resource index).

The Color can be set as a color name or the RBG565 color format. (Read More)

Example:

@PRFONT 0x8002,Red\r
@PRFONT 0x8002,0xf800\r
@PRFONT 24,White\r

Command:

@PRAREA xs,ys,xe,ye\r

Meaning:

Set the top-left corner (xs, ys) and right-bottom corner (xe, ye) as the area for direct printing area.
The default printing area is full screen. Please don't set the area over the screen width/height.

Example:

@PRAREA 40,50,240,300\r

Command:

@PRINTB Color\r

Meaning:

Set the background color of the printing area.
After setting up the color, the screen won't be refreshed. Need to refresh the screen with the @PRCLR command.

Example:

@PRINTB Blue\r
@PRINTB 0x001f\r

Command:

@PRSTRCOL Color\r

Meaning:

Set the direct printing font color.
This command won't affect the printed words, only the words printed AFTER setting the font color.

Example:

@ PRSTRCOL Cyan\r

Command:

@PRCLR\r

Meaning:

Fill the current printing area with the printing background color. Also, this command will clear the printing buffer.

Example:

@PRCLR\r

GUI Commands

Command:

@READ tarID\r

Meaning:

Read the data of target control (ID=tarID). The ATFC Module will return different data according to the control types.

Example:

@READ 102\r

Command:

@SET tarID,value\r

Meaning:

Set the value to target control (ID=tarID).

Example:

@SET 102,345\r

Command:

@GUIR\r

Meaning:

Returns the index of the current GUI.

Example:

@GUIR\r

Return:

@0 1\r

Command:

@GUIS gui_index\r

Meaning:

Switch to the target GUI (index=gui_index).

Example:

@GUIS 2\r

Video/Audio Commands

Command:

@AVI xs,ys,w,h,filename\r

Meaning:

Play the video file stored inside the AFTC built-in flash memory. AVI file in MJPEG codec is supported.
(xs,ys) is the top-left corner. w,h are the width/height of the video. filename is the video filename.

Example:

@AVI 10,10,460,250,g0.avi\r

Command:

@AUDIO filename\r

Meaning:

Play the audio file stored inside the AFTC built-in flash memory.

Example:

@AUDIO test.mp3\r

Power Saving Command

Command:

@LOWPOW value\r

Meaning:

The possible values are 0,1 and 2.

  • 0 = Turn off power-saving mode.
  • 1 = Turn on power-saving mode. Screen backlight off. To wake up the screen, turn off the power-saving mode or touch the screen.
  • 2 = Turn on deep-sleep mode. Only turning power-saving mode off to wake up.

Read more about Power Saving mode.

Example:

@LOWPOW 1\r

Control Setting Command

Command:

@CTRL control_ID,par1,par2... parN\r

Meaning:

Set the target control with certain parameters. Different controls take different parameters.

Read more about the control setting command.

Example:

@CTRL 101,1\r

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

×
×

Cart