Arduino-ILI9341驱动-SPI接口TFTLCD实现触摸功能系列之触控开关二

Arduino-ILI9341驱动-SPI接口TFTLCD实现触摸功能系列之触控开关二

1.概述

这篇文章在触摸屏上绘制一个开关,通过点击开关实现控制灯的开关功能。

2.硬件

硬件连接参考第一篇文章介绍
Arduino-ILI9341驱动-SPI接口TFTLCD实现触摸功能系列之获取触控坐标一

3.实现触控开关效果

3.1.完整代码

首先给出实现点击屏幕实现开关状态改变的完整代码,然后在详细说明实现思路以及代码中每个部分的作用。

1.图标位图

在代码中开关图标是十六进制的位图,因此在字体取模软件PCtoLCD2002软件绘制开关图形即可,下面是绘制好的代码。
在主程序同路径下新建一个switch.c文件然后将下面的内容复制到该文件中。

#ifdef __AVR__
#include <avr/pgmspace.h>
#elif defined(ESP8266)
#include <pgmspace.h>
#else
#define PROGMEM
#endifconst unsigned char switch_off_1[450] PROGMEM = 
{ /* 0X00,0X10,0X0F,0X00,0X0F,0X00,0X01,0X1B, */
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X79,0XCE,0XD7,0XBD,0X96,0XB5,0X96,0XB5,0X96,0XB5,
0XD7,0XBD,0X79,0XCE,0X9E,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XB6,0XB5,0X38,0XC6,0X3C,0XE7,0X9E,0XF7,0X9E,0XF7,0X9E,0XF7,0X3C,0XE7,
0X38,0XC6,0XB6,0XB5,0X5D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XB6,0XB5,
0X79,0XCE,0XBE,0XF7,0XDB,0XD6,0X39,0XC6,0X39,0XC6,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0X5A,0XC7,0X39,0XE7,0X39,
0XA6,0X31,0X34,0XA5,0XFF,0XFF,0XC7,0X39,0X28,0X42,0X08,0X42,0X28,0X42,0X30,0X84,
0X31,0X84,0X55,0XA5,0XFF,0XFF,0X9E,0XF7,0X92,0X8C,0X10,0X84,0X51,0X84,0X72,0X8C,
0XFF,0XFF,0XFF,0XFF,0X71,0X8C,0X51,0X84,0X10,0X84,0X92,0X94,0X9E,0XF7,0XFF,0XFF,
0X34,0XA5,0X31,0X84,0X10,0X84,0X28,0X42,0X08,0X42,0X28,0X42,0XC7,0X39,0X10,0X84,
0XFF,0XFF,0X28,0X42,0X49,0X4A,0X49,0X4A,0X28,0X42,0XEB,0X5A,0X30,0X84,0XDB,0XDE,
0XFF,0XFF,0XB6,0XB5,0XEF,0X7B,0X51,0X84,0X31,0X84,0X30,0X84,0X18,0XBE,0XF7,0XBD,
0X30,0X84,0X31,0X84,0X51,0X84,0XEF,0X7B,0XB7,0XB5,0XFF,0XFF,0XBA,0XD6,0X10,0X84,
0XEB,0X5A,0X28,0X42,0X49,0X4A,0X49,0X4A,0X28,0X42,0X2C,0X63,0XFF,0XFF,0X69,0X4A,
0X69,0X4A,0X69,0X4A,0X69,0X4A,0X49,0X4A,0X6D,0X6B,0XDF,0XFF,0XDF,0XFF,0X71,0X8C,
0X10,0X84,0X30,0X84,0X31,0X84,0X30,0X84,0XEF,0X7B,0XF0,0X7B,0X30,0X84,0X30,0X84,
0X30,0X84,0X10,0X7C,0X72,0X8C,0XFF,0XFF,0XBE,0XF7,0X4D,0X6B,0X49,0X4A,0X69,0X4A,
0X69,0X4A,0X69,0X4A,0X69,0X4A,0XEB,0X5A,0XFF,0XFF,0XAA,0X52,0XAA,0X52,0XAA,0X52,
0XAA,0X52,0X69,0X4A,0X4D,0X6B,0XFF,0XFF,0X5D,0XEF,0X10,0X84,0X10,0X84,0X10,0X84,
0X10,0X84,0X10,0X84,0X10,0X84,0X10,0X84,0X10,0X84,0X10,0X84,0X10,0X84,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,0X10,0X84,0X10,0X84,0X10,0X84,0X10,0X84,
0X10,0X84,0X10,0X84,0XCF,0X7B,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XEF,0X7B,0X51,0X8C,
0X30,0X84,0X30,0X84,0X30,0X84,0X30,0X84,0X30,0X84,0X10,0X84,0XEF,0X7B,0X34,0XA5,
0XBA,0XD6,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XBA,0XD6,0X34,0XA5,0XEF,0X7B,
0X10,0X84,0X30,0X84,0X30,0X84,0X30,0X84,0X30,0X84,0X30,0X84,0X51,0X8C,0XEF,0X7B,
0X10,0X84,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X71,0X8C,0X71,0X8C,0X51,0X8C,
0X71,0X8C,0X71,0X8C,0X71,0X8C,0X71,0X8C,0X51,0X8C,0X10,0X84,0X30,0X84,0X71,0X8C,
0XD3,0X9C,0XD3,0X9C,0X92,0X94,0X30,0X84,0X10,0X84,0X51,0X8C,0X71,0X8C,0X71,0X8C,
0X71,0X8C,0X51,0X8C,0X51,0X8C,0X71,0X8C,0X51,0X8C,0X8E,0X73,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XB2,0X94,0X92,0X94,0X92,0X94,0X92,0X94,
0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,0X71,0X8C,0X71,0X8C,0X71,0X8C,
0X71,0X8C,0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,0X92,0X94,
0X92,0X94,0XB2,0X94,0X8E,0X73,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XAE,0X73,0XF3,0X9C,0XD3,0X9C,0XB2,0X94,0XD3,0X9C,0XD3,0X9C,
0XD3,0X9C,0XD3,0X9C,0XD3,0X9C,0XD3,0X9C,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0XD6,0X9A,0XD6,0X59,0XCE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
};
2.程序代码
#include <LCDWIKI_GUI.h>    //Core graphics library
#include <LCDWIKI_SPI.h>    //Hardware-specific library
#include <LCDWIKI_TOUCH.h>  //touch screen library
#include "switch_font.c"//定义TFT屏幕引脚
#define MODEL ILI9341
#define CS A5
#define RST A4
#define CD A3#define MOSI 11
#define SCK 13
#define LED A0
#define MISO 12// 定义TFT屏幕触控引脚
#define TCLK 3
#define TCS 2
#define TDIN 5
#define TDOUT 4
#define TIRQ 6// 定义触控x和y轴后返回值的变量
uint16_t px, py;// 定义颜色
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF// 定义开关变量初始值
boolean switch_flag_1 = true;// 创造LCD对象
LCDWIKI_SPI my_lcd(MODEL, CS, CD, MISO, MOSI, RST, SCK, LED);  //model,cs,dc,miso,mosi,reset,sck,led// 创建触控对象
LCDWIKI_TOUCH my_touch(TCS, TCLK, TDOUT, TDIN, TIRQ);  //tcs,tclk,tdout,tdin,tirq/****************************************************************  @brief    判断px和py触控的x轴和y轴坐标位置是否在矩形范围内*  @param    x1:x轴坐标起点位置;x2:x轴终点位置;y1:y轴起点位置;y2:y轴终点位置;*  @param    px:触控的x轴坐标;py:触控的y轴坐标 *  @note     备注**************************************************************/boolean is_pressed(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t px, int16_t py) {if ((px > x1 && px < x2) && (py > y1 && py < y2)) {return true;} else {return false;}
}/****************************************************************  @brief    显示文本*  @param    *str:文本内容;x,y:文本显示的x和y轴坐标位置;csize:字号;fc:文本颜色;bc:文本背景颜色;mode:文本模式*  @param    *  @note     **************************************************************/
void show_string(uint8_t *str, int16_t x, int16_t y, uint8_t csize, uint16_t fc, uint16_t bc, boolean mode) {my_lcd.Set_Text_Mode(mode);my_lcd.Set_Text_Size(csize);my_lcd.Set_Text_colour(fc);my_lcd.Set_Text_Back_colour(bc);my_lcd.Print_String(str, x, y);
}/****************************************************************  @brief    显示开关图标*  @param    x1, y1, x2, y2设置图标可显示区域的窗口大小*  @param    *color_buf:图标, int16_t buf_size:图标尺寸,*  @note     **************************************************************/
void show_picture(const uint8_t *color_buf, int16_t buf_size, int16_t x1, int16_t y1, int16_t x2, int16_t y2) {my_lcd.Set_Addr_Window(x1, y1, x2, y2);my_lcd.Push_Any_Color(color_buf, buf_size, 1, 1);
}void setup() {// 打开串口Serial.begin(9600);// 创建LCDWIKI_SPI对象my_lcd.Init_LCD();// 设置屏幕显示方向my_lcd.Set_Rotation(0);//创建LCDWIKI_TOUCH对象my_touch.TP_Init(my_lcd.Get_Rotation(), my_lcd.Get_Display_Width(), my_lcd.Get_Display_Height());// 设置触控方向my_touch.TP_Set_Rotation(3);//设置背景颜色my_lcd.Fill_Screen(WHITE);my_lcd.Set_Draw_color(192, 192, 192);my_lcd.Draw_Fast_HLine(0, 3, my_lcd.Get_Display_Width());// 绘制开关背景图形show_picture(switch_on_2, sizeof(switch_on_2) / 2, 5, 5, 34, 34);// 绘制开关文本内容和属性show_string("switch is on ", 60, 11, 2, GREEN, BLACK, 1);
}void loop() {px = 0;py = 0;my_touch.TP_Scan(0);/*my_touch.TP_Get_State() & TP_PRES_DOWN 是一个位运算表达式,它使用了按位与(bitwise AND)操作符 &。这个表达式通常用于检查TP_Get_State()返回的触摸状态值中是否设置了特定的位(bit),这个位由TP_PRES_DOWN定义。TP_PRES_DOWN通常被定义为类似0x01、0x02、0x04、0x08、0x10等的值,这些值分别对应二进制中的0001、0010、0100、1000等。这些值只有一个位是1,其余位都是0。这样,当使用按位与操作符时,只有TP_Get_State()返回的值的对应位也是1时,结果才不会是0。如果没有这个判断,px = my_touch.x;会不断的获取坐标值,也就是说没有按压屏幕也会一直输出坐标值*/if (my_touch.TP_Get_State() & TP_PRES_DOWN) {// 获取触控后x、y轴坐标px = my_touch.x;py = my_touch.y;Serial.print("触屏X轴坐标=");Serial.println(px);Serial.print("触屏Y轴坐标=");Serial.println(py);}// 判断点击的位置如果在该按钮的范围内,则进入。if (is_pressed(5, 5, 34, 34, px, py)) {// 判断当前开关状态为true则进入if,否则进入elseif (switch_flag_1) {// 显示关闭按钮图标show_picture(switch_off_2, sizeof(switch_off_2) / 2, 5, 5, 34, 34);// 设置颜色my_lcd.Set_Draw_color(WHITE);/****************************************************************  @brief    绘制一个矩形框,该函数内部调用了Fill_Rect函数,该函数才是执行绘制矩形框函数。它从Set_Draw_color函数获取矩形框背景色*  @param    x1,y1,x2,y2绘制矩形框x轴和y轴启动和终点*  @param    *  @note     **************************************************************/my_lcd.Fill_Rectangle(60, 11, 216, 27);// 显示关闭文本show_string("switch is off ", 60, 11, 2, RED, WHITE, 1);// 修改开关全局状态为关闭switch_flag_1 = false;} else {show_picture(switch_on_2, sizeof(switch_on_2) / 2, 5, 5, 34, 34);my_lcd.Set_Draw_color(WHITE);my_lcd.Fill_Rectangle(60, 11, 216, 27);show_string("switch is on ", 60, 11, 2, GREEN, BLACK, 1);switch_flag_1 = true;}delay(100);}
}

3.2.实现思路

触控屏幕实现开关状态变化在思路上分成了两个支线,一条线是点亮屏幕后显示的初始化内容,另一个条线是点击屏幕后显示的内容。

1.初始化状态
在初始化状态需要显示两个类型的内容分别是文本开关图标

2.点击后状态
当点击屏幕后执行流程如下

  1. 首先判断屏幕是否被点击
  2. 判断点击屏幕x和y轴坐标值是否在开关按钮范围内
  3. 展示关闭按钮文本和关闭按钮图标

3.3.实现代码

1.初始化状态

封装显示文本函数

/****************************************************************  @brief    显示文本*  @param    *str:文本内容;x,y:文本显示的x和y轴坐标位置;csize:字号;fc:文本颜色;bc:文本背景颜色;mode:文本模式*  @param    *  @note     **************************************************************/
void show_string(uint8_t *str, int16_t x, int16_t y, uint8_t csize, uint16_t fc, uint16_t bc, boolean mode) {my_lcd.Set_Text_Mode(mode);my_lcd.Set_Text_Size(csize);my_lcd.Set_Text_colour(fc);my_lcd.Set_Text_Back_colour(bc);my_lcd.Print_String(str, x, y);
}

封装显示图标函数

/****************************************************************  @brief    显示开关图标*  @param    x1, y1, x2, y2设置图标可显示区域的窗口大小*  @param    *color_buf:图标, int16_t buf_size:图标尺寸,*  @note     **************************************************************/
void show_picture(const uint8_t *color_buf, int16_t buf_size, int16_t x1, int16_t y1, int16_t x2, int16_t y2) {my_lcd.Set_Addr_Window(x1, y1, x2, y2);my_lcd.Push_Any_Color(color_buf, buf_size, 1, 1);
}
2.点击后状态

1.获取屏幕点击的坐标

  /*my_touch.TP_Get_State() & TP_PRES_DOWN 是一个位运算表达式,它使用了按位与(bitwise AND)操作符 &。这个表达式通常用于检查TP_Get_State()返回的触摸状态值中是否设置了特定的位(bit),这个位由TP_PRES_DOWN定义。TP_PRES_DOWN通常被定义为类似0x01、0x02、0x04、0x08、0x10等的值,这些值分别对应二进制中的0001、0010、0100、1000等。这些值只有一个位是1,其余位都是0。这样,当使用按位与操作符时,只有TP_Get_State()返回的值的对应位也是1时,结果才不会是0。如果没有这个判断,px = my_touch.x;会不断的获取坐标值,也就是说没有按压屏幕也会一直输出坐标值*/if (my_touch.TP_Get_State() & TP_PRES_DOWN) {// 获取触控后x、y轴坐标px = my_touch.x;py = my_touch.y;Serial.print("触屏X轴坐标=");Serial.println(px);Serial.print("触屏Y轴坐标=");Serial.println(py);}

2.封装判断点击屏幕x和y轴坐标值是否在开关按钮范围内函数

/****************************************************************  @brief    判断px和py触控的x轴和y轴坐标位置是否在矩形范围内*  @param    x1:x轴坐标起点位置;x2:x轴终点位置;y1:y轴起点位置;y2:y轴终点位置;*  @param    px:触控的x轴坐标;py:触控的y轴坐标 *  @note     备注**************************************************************/boolean is_pressed(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t px, int16_t py) {if ((px > x1 && px < x2) && (py > y1 && py < y2)) {return true;} else {return false;}
}

3.改变文本和图标状态

if (is_pressed(5, 5, 34, 34, px, py)) {// 判断当前开关状态为true则进入if,否则进入elseif (switch_flag_1) {// 显示关闭按钮图标show_picture(switch_off_2, sizeof(switch_off_2) / 2, 5, 5, 34, 34);// 设置颜色my_lcd.Set_Draw_color(WHITE);/****************************************************************  @brief    绘制一个矩形框,该函数内部调用了Fill_Rect函数,该函数才是执行绘制矩形框函数。它从Set_Draw_color函数获取矩形框背景色*  @param    x1,y1,x2,y2绘制矩形框x轴和y轴启动和终点*  @param    *  @note     **************************************************************/my_lcd.Fill_Rectangle(60, 11, 216, 27);// 显示关闭文本show_string("switch is off ", 60, 11, 2, RED, WHITE, 1);// 修改开关全局状态为关闭switch_flag_1 = false;} else {show_picture(switch_on_2, sizeof(switch_on_2) / 2, 5, 5, 34, 34);my_lcd.Set_Draw_color(WHITE);my_lcd.Fill_Rectangle(60, 11, 216, 27);show_string("switch is on ", 60, 11, 2, GREEN, BLACK, 1);switch_flag_1 = true;}

3.4.实验结果

初始状态屏幕显示打开状态
在这里插入图片描述

点击屏幕显示关闭状态
在这里插入图片描述

3.5.其他图案开关

学会了触控屏幕改变开关状态后,下面增加了几个开关图标的样式,完整代码如下。

#include <LCDWIKI_GUI.h>    //Core graphics library
#include <LCDWIKI_SPI.h>    //Hardware-specific library
#include <LCDWIKI_TOUCH.h>  //touch screen library
#include "switch_font.c"//定义TFT屏幕引脚
#define MODEL ILI9341
#define CS A5
#define RST A4
#define CD A3#define MOSI 11
#define SCK 13
#define LED A0
#define MISO 12// 定义TFT屏幕触控引脚
#define TCLK 3
#define TCS 2
#define TDIN 5
#define TDOUT 4
#define TIRQ 6// 定义触控x和y轴后返回值的变量
uint16_t px, py;// 定义颜色
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF// 定义开关变量初始值
boolean switch_flag_1 = true, switch_flag_2 = true, switch_flag_3 = true, switch_flag_4 = true, switch_flag_5 = true, switch_flag_6 = true;// 创造LCD对象
LCDWIKI_SPI my_lcd(MODEL, CS, CD, MISO, MOSI, RST, SCK, LED);  //model,cs,dc,miso,mosi,reset,sck,led// 创建触控对象
LCDWIKI_TOUCH my_touch(TCS, TCLK, TDOUT, TDIN, TIRQ);  //tcs,tclk,tdout,tdin,tirq/****************************************************************  @brief    判断px和py触控的x轴和y轴坐标位置是否在矩形范围内*  @param    x1:x轴坐标起点位置;x2:x轴终点位置;y1:y轴起点位置;y2:y轴终点位置;*  @param    px:触控的x轴坐标;py:触控的y轴坐标 *  @note     备注**************************************************************/boolean is_pressed(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t px, int16_t py) {if ((px > x1 && px < x2) && (py > y1 && py < y2)) {return true;} else {return false;}
}/****************************************************************  @brief    显示文本*  @param    *str:文本内容;x,y:文本显示的x和y轴坐标位置;csize:字号;fc:文本颜色;bc:文本背景颜色;mode:文本模式*  @param    *  @note     **************************************************************/
void show_string(uint8_t *str, int16_t x, int16_t y, uint8_t csize, uint16_t fc, uint16_t bc, boolean mode) {my_lcd.Set_Text_Mode(mode);my_lcd.Set_Text_Size(csize);my_lcd.Set_Text_colour(fc);my_lcd.Set_Text_Back_colour(bc);my_lcd.Print_String(str, x, y);
}/****************************************************************  @brief    显示开关图标*  @param    x1, y1, x2, y2设置图标可显示区域的窗口大小*  @param    *color_buf:图标, int16_t buf_size:图标尺寸,*  @note     **************************************************************/
void show_picture(const uint8_t *color_buf, int16_t buf_size, int16_t x1, int16_t y1, int16_t x2, int16_t y2) {my_lcd.Set_Addr_Window(x1, y1, x2, y2);my_lcd.Push_Any_Color(color_buf, buf_size, 1, 1);
}void setup() {// 打开串口Serial.begin(9600);// 创建LCDWIKI_SPI对象my_lcd.Init_LCD();// 设置屏幕显示方向my_lcd.Set_Rotation(0);//创建LCDWIKI_TOUCH对象my_touch.TP_Init(my_lcd.Get_Rotation(), my_lcd.Get_Display_Width(), my_lcd.Get_Display_Height());// 设置触控方向my_touch.TP_Set_Rotation(3);//设置背景颜色my_lcd.Fill_Screen(WHITE);my_lcd.Set_Draw_color(192, 192, 192);my_lcd.Draw_Fast_HLine(0, 3, my_lcd.Get_Display_Width());// 绘制开关背景图形show_picture(switch_on_2, sizeof(switch_on_2) / 2, 5, 5, 34, 34);// 绘制开关文本内容和属性show_string("switch is on ", 60, 11, 2, GREEN, BLACK, 1);my_lcd.Draw_Fast_HLine(0, 57, my_lcd.Get_Display_Width());show_string("wifi setting", 5, 40, 2, BLACK, BLACK, 1);show_picture(switch_on_3, sizeof(switch_on_3) / 2, 195, 40, 234, 54);my_lcd.Draw_Fast_HLine(0, 57, my_lcd.Get_Display_Width());show_string("bt setting", 5, 60, 2, BLACK, BLACK, 1);show_picture(switch_on_3, sizeof(switch_on_3) / 2, 195, 60, 234, 74);my_lcd.Draw_Fast_HLine(0, 77, my_lcd.Get_Display_Width());show_string("auto time", 5, 80, 2, BLACK, BLACK, 1);show_picture(switch_on_1, sizeof(switch_on_1) / 2, 204, 80, 218, 94);my_lcd.Draw_Fast_HLine(0, 97, my_lcd.Get_Display_Width());show_string("enable lock", 5, 100, 2, BLACK, BLACK, 1);show_picture(switch_on_1, sizeof(switch_on_1) / 2, 204, 100, 218, 114);
}void loop() {px = 0;py = 0;my_touch.TP_Scan(0);/*my_touch.TP_Get_State() & TP_PRES_DOWN 是一个位运算表达式,它使用了按位与(bitwise AND)操作符 &。这个表达式通常用于检查TP_Get_State()返回的触摸状态值中是否设置了特定的位(bit),这个位由TP_PRES_DOWN定义。TP_PRES_DOWN通常被定义为类似0x01、0x02、0x04、0x08、0x10等的值,这些值分别对应二进制中的0001、0010、0100、1000等。这些值只有一个位是1,其余位都是0。这样,当使用按位与操作符时,只有TP_Get_State()返回的值的对应位也是1时,结果才不会是0。如果没有这个判断,px = my_touch.x;会不断的获取坐标值,也就是说没有按压屏幕也会一直输出坐标值*/if (my_touch.TP_Get_State() & TP_PRES_DOWN) {// 获取触控后x、y轴坐标px = my_touch.x;py = my_touch.y;Serial.print("触屏X轴坐标=");Serial.println(px);Serial.print("触屏Y轴坐标=");Serial.println(py);}// 判断点击的位置如果在该按钮的范围内,则进入。if (is_pressed(5, 5, 34, 34, px, py)) {// 判断当前开关状态为true则进入if,否则进入elseif (switch_flag_1) {// 显示关闭按钮图标show_picture(switch_off_2, sizeof(switch_off_2) / 2, 5, 5, 34, 34);// 设置颜色my_lcd.Set_Draw_color(WHITE);/****************************************************************  @brief    绘制一个矩形框,该函数内部调用了Fill_Rect函数,该函数才是执行绘制矩形框函数。它从Set_Draw_color函数获取矩形框背景色*  @param    x1,y1,x2,y2绘制矩形框x轴和y轴启动和终点*  @param    *  @note     **************************************************************/my_lcd.Fill_Rectangle(60, 11, 216, 27);// 显示关闭文本show_string("switch is off ", 60, 11, 2, RED, WHITE, 1);// 修改开关全局状态为关闭switch_flag_1 = false;} else {show_picture(switch_on_2, sizeof(switch_on_2) / 2, 5, 5, 34, 34);my_lcd.Set_Draw_color(WHITE);my_lcd.Fill_Rectangle(60, 11, 216, 27);show_string("switch is on ", 60, 11, 2, GREEN, BLACK, 1);switch_flag_1 = true;}delay(100);}if (is_pressed(195, 40, 234, 54, px, py)) {if (switch_flag_2) {show_picture(switch_off_3, sizeof(switch_off_3) / 2, 195, 40, 234, 54);switch_flag_2 = false;} else {show_picture(switch_on_3, sizeof(switch_on_3) / 2, 195, 40, 234, 54);switch_flag_2 = true;}delay(100);}if (is_pressed(195, 60, 234, 74, px, py)) {if (switch_flag_3) {show_picture(switch_off_3, sizeof(switch_off_3) / 2, 195, 60, 234, 74);switch_flag_3 = false;} else {show_picture(switch_on_3, sizeof(switch_on_3) / 2, 195, 60, 234, 74);switch_flag_3 = true;}delay(100);}if (is_pressed(205, 81, 217, 93, px, py)) {if (switch_flag_4) {show_picture(switch_off_1, sizeof(switch_off_1) / 2, 204, 80, 218, 94);switch_flag_4 = false;} else {show_picture(switch_on_1, sizeof(switch_on_1) / 2, 204, 80, 218, 94);switch_flag_4 = true;}delay(100);}if (is_pressed(205, 101, 217, 113, px, py)) {if (switch_flag_5) {show_picture(switch_off_1, sizeof(switch_off_1) / 2, 204, 100, 218, 114);switch_flag_5 = false;} else {show_picture(switch_on_1, sizeof(switch_on_1) / 2, 204, 100, 218, 114);switch_flag_5 = true;}delay(100);}
}

显示效果
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/837500.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

在线caj转换成pdf免费吗?caj变成pdf很容易!点进来!

在数字化阅读日益盛行的今天&#xff0c;各种电子文献格式层出不穷&#xff0c;其中CAJ和PDF无疑是两种最为常见的格式。CAJ是中国知网推出的一种专用全文阅读格式&#xff0c;而PDF则因其跨平台、不易被修改的特性&#xff0c;受到了广大读者的青睐。因此&#xff0c;将CAJ格式…

【C++】 类的新成员:static成员和类的好朋友:友元

欢迎来到CILMY23的博客 &#x1f3c6;本篇主题为&#xff1a; 类的新成员&#xff1a;static成员和类的好朋友&#xff1a;友元 &#x1f3c6;个人主页&#xff1a;CILMY23-CSDN博客 &#x1f3c6;系列专栏&#xff1a;Python | C | C语言 | 数据结构与算法 | 贪心算法 | Li…

网络编程套接字(一) 【简单的Udp网络程序】

网络编程套接字<一> 理解源端口号和目的端口号PORT VS PID认识TCP协议和UDP协议网络字节序socket编程接口sockaddr结构简单的UDP网络程序服务端创建套接字服务端绑定运行服务器客户端创建套接字关于客户端的绑定问题启动客户端启动客户端本地测试INADDR_ANY 理解源端口号…

怎么给视频加水印?2招轻松搞定

在数字媒体时代&#xff0c;视频水印作为一种有效的版权保护手段&#xff0c;被广泛应用于各种场景。给视频添加水印不仅可以防止内容被恶意盗用&#xff0c;还能增加视频的辨识度&#xff0c;提升品牌形象。本文将为您介绍2种简单易行的方法&#xff0c;教您怎么给视频加水印&…

Linux进程控制——Linux进程等待

前言&#xff1a;接着前面进程终止&#xff0c;话不多说我们进入Linux进程等待的学习&#xff0c;如果你还不了解进程终止建议先了解&#xff1a; Linux进程终止 本篇主要内容&#xff1a; 什么是进程等待 为什么要进行进程等待 如何进程等待 进程等待 1. 进程等待的概念2. 进…

软件杯 深度学习的水果识别 opencv python

文章目录 0 前言2 开发简介3 识别原理3.1 传统图像识别原理3.2 深度学习水果识别 4 数据集5 部分关键代码5.1 处理训练集的数据结构5.2 模型网络结构5.3 训练模型 6 识别效果7 最后 0 前言 &#x1f525; 优质竞赛项目系列&#xff0c;今天要分享的是 &#x1f6a9; 深度学习…

【数据结构】平衡二叉树(插入、查找、删除)解析+完整代码

3.2 平衡二叉树 3.2.1 定义 平衡二叉树&#xff0c;简称平衡树&#xff08;AVL树&#xff09; 树上任一结点的左右子树高度差不超过1。 结点的平衡因子左子树高-右子树高 3.2.2 插入操作 插入结点后&#xff0c;可能造成不平衡 要调整最小不平衡子树&#xff0c;使其恢复平衡。…

【回溯 代数系统】679. 24 点游戏

本文涉及知识点 回溯 代数系统 LeetCode679. 24 点游戏 给定一个长度为4的整数数组 cards 。你有 4 张卡片&#xff0c;每张卡片上都包含一个范围在 [1,9] 的数字。您应该使用运算符 [‘’, ‘-’, ‘*’, ‘/’] 和括号 ‘(’ 和 ‘)’ 将这些卡片上的数字排列成数学表达式…

SQLserver - 笔记

1 SQLserver - 用户管理 4、SQL SERVER数据库用户管理_哔哩哔哩_bilibili 创建用户 - user 2.选择用户&#xff0c;修改属性

Qt---绘图和绘图设备

一、QPainter绘图 绘图事件 void paintEvent() 声明一个画家对象&#xff0c;OPainter painter(this) this指定绘图设备 画线、画圆、画矩形、画文字 设置画笔QPen 设置画笔宽度、风格 设置画刷QBrush 设置画刷风格 代码示例&#xff1a; #includ…

LeetCode---循环队列

循环队列就是只有固定的内存&#xff0c;存数据&#xff0c;出数据&#xff0c;但是也和队列一样&#xff0c;先进先出。如下图所示&#xff0c;这是他的样子 在head出&#xff0c;tail进&#xff0c;但是这个如果用数组解决的话&#xff0c;就有问题&#xff0c;力扣给我们的接…

Building3D An Urban-Scale Dataset and Benchmarks 论文阅读

文章主页 Building3D 任务 提出了一个城市规模的数据集&#xff0c;由超过 16 万座建筑物以及相应的点云、网格和线框模型组成&#xff0c;覆盖爱沙尼亚的 16 个城市&#xff0c;面积约 998 平方公里。 动机 现有的3D建模数据集主要集中在家具或汽车等常见物体上。缺乏建…

CAPL入门之使用CAPL记录测试Logging

0 前言 以往测试的log都是直接从trace导出&#xff0c;但是最近发现trace中能导出的数据是有限的&#xff0c;如果测试的时间过长&#xff0c;新的数据就会把之前的数据全部覆盖&#xff0c;并且对于长时间的测试&#xff0c;直接导出trace的内容也会造成查找效率低下的问题。因…

centos7下使用docker安装fastdfs服务

先查看容器是否已经存在 docker ps -a 删除掉之前的tracker及storage服务 docker rm tracker docker rm storage 1、没有镜像先下载镜像 docker pull morunchang/fastdfs 2、运行服务 a、不指定物理服务器路径 docker run -d --name tracker --nethost morunchang/fastdfs sh…

Java面试八股之String s = “String“;和String s = new String(“String“);有什么区别

Java中String s "String";和String s new String("String");有什么区别 字符串字面量&#xff08;"String"&#xff09;&#xff1a; 常量池&#xff1a;使用字面量方式创建字符串时&#xff0c;Java虚拟机&#xff08;JVM&#xff09;会在运…

Jmeter接口测试之参数化

在接口测试中&#xff0c;某些时候一些场景会使用到参数化的场景&#xff0c;参数化简单的说就是同一个请求需要不同的数据&#xff0c;比如在性能测试中需要并发多个用户的场景&#xff0c;这样的目的是为了模拟真实的用户场景&#xff0c;需要模拟不同的账号&#xff0c;这里…

算法练习第21天|216.组合总和|||、17.电话号码的字母组合

216.组合总和 III 216. 组合总和 III - 力扣&#xff08;LeetCode&#xff09;https://leetcode.cn/problems/combination-sum-iii/ 题目描述&#xff1a; 找出所有相加之和为 n 的 k 个数的组合&#xff0c;且满足下列条件&#xff1a; 只使用数字1到9每个数字 最多使用一…

北亚MF2200手机取证平台介绍

一、产品介绍。 北亚MF2200手机取证平台是由北亚企安科技&#xff08;北京&#xff09;有限公司&#xff08;Frombyte&#xff09;自主研发的一款针对智能手机&#xff08;iPhone、Android&#xff09;及 iPad 取证分析的法证平台。本平台采集速度快&#xff0c;可通过自动提取…

【VUE】VUE3绘制箭头组件

效果预览&#xff1a; 长、宽、粗细等等根据情况合理调整即可。 组件&#xff1a; <template><div class"line" :style"props.arrowsColor"></div> </template><script setup> import { defineProps, ref, onMounted } fr…

为什么使用AI 在游戏中不犯法

使用AI在游戏中本身并不违法&#xff0c;甚至在很多情况下&#xff0c;游戏公司自己也会在游戏中集成AI来提高游戏体验&#xff0c;例如通过AI驱动的非玩家角色&#xff08;NPC&#xff09;来增加游戏的互动性和挑战性。然而&#xff0c;使用AI是否违法取决于AI的使用方式和目的…