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

news2024/12/23 23:29:16

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
#endif

const 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,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8C,0X92,0X94,0XCB,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,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X30,0X84,0XCF,0X7B,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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D6,
0X9A,0XD6,0X9A,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,否则进入else
    if (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,否则进入else
    if (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,否则进入else
    if (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.coloradmin.cn/o/1676676.html

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

相关文章

使用Caché管理工具

Cach通过一个web工具来对其进行系统管理和完成管理任务,该方法的一个好处是不必将Cach安装到用于管理的系统上。目前,通过网络远程管理和控制对站点的访问,这些都比较容易。因为数据及其格式信息都直接来自被管理的系统,因此,这也可以最小化跨版本的兼容问题。 本文将描述…

【知识碎片】2024_05_14

本篇记录了两道关于位运算的选择题&#xff0c;和一道有点思维的代码题。 C语言碎片知识 求函数返回值&#xff0c;传入 -1 &#xff0c;则在64位机器上函数返回&#xff08; &#xff09; int func(int x) {int count 0;while (x){count;x x&(x - 1);//与运算} return c…

Java医院绩效核算系统与his对接所需数据有哪些?java+springboot+MySQL医院绩效管理系统-构建智慧医疗生态

Java医院绩效核算系统与his对接所需数据有哪些&#xff1f;javaspringbootMySQL医院绩效管理系统-构建智慧医疗生态 医院绩效核算系统与his对接所需数据 1、诊察工作量绩效&#xff1a;信息系统-财务权限-统计报表-报表浏览-财务常用报表-门诊医生工作量报表 2、判读及操作工…

微信小程序 - - - - - 使用TDesign库(微信小程序UI库)

使用TDesign库 1. 初始化依赖2. 安装TDesgin3. npm构建3. 修改 app.json 1. 初始化依赖 npm init -y2. 安装TDesgin yarn add tdesign-miniprogram -S --productionor npm install tdesign-miniprogram -S --production3. npm构建 3. 修改 app.json 将 app.json 中的 “styl…

CTF如何学习?

CTF如何学习&#xff1f;打CTF有什么用 CTF本身有几个常见的领域 MISC WEB [逆向 密码学](https://www.zhihu.com/search?q逆向 密码学&search_sourceEntity&hybrid_search_sourceEntity&hybrid_search_extra{“sourceType”%3A"answer"%2C"sourc…

ubuntu 22.04 安装 RTX 4090 显卡驱动 GPU Driver(PyTorch准备)

文章目录 1. 参考文章2. 检查GPU是Nvidia3. 卸载已有驱动3.1. 命令删除3.2. 老驱动包 4. 官网下载驱动5. 运行5.1. 远程安装关闭交互界面5.2. 运行5.3. 打开交互界面 6. 检测与后续安装 1. 参考文章 https://blog.csdn.net/JineD/article/details/129432308 2. 检查GPU是Nvid…

【MySQL】Mysql——安装指南(Linux)

MySQL8.0.26-Linux版安装 1. 准备一台Linux服务器 云服务器或者虚拟机都可以; Linux的版本为 CentOS7; 2. 下载Linux版MySQL安装包 3. 上传MySQL安装包 4. 创建目录,并解压 mkdir mysqltar -xvf mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar -C mysql5. 安装mysql的安装包 …

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

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

iOS 创建pch文件

1.参考链接&#xff08;xcode8添加方法&#xff0c;之前的跟这个差不多&#xff09;&#xff1a; 参考链接 2.自我总结&#xff1a; &#xff08;1&#xff09;创建pch文件: 注意点&#xff1a;1&#xff09;注意选中所有的targets&#xff08;看图明义&#xff09; 2&…

关于链表相关的OJ题

✨✨✨专栏&#xff1a;数据结构 &#x1f9d1;‍&#x1f393;个人主页&#xff1a;SWsunlight 一、 OJ题 返回倒数第K个节点&#xff1a; 1、遍历链表一遍:用2个指针&#xff0c;phead和ptail先让ptail先走k步&#xff0c;然后让2个指针一起走&#xff0c;快的走到NULL即…

计算机发展史故事【13】

微电脑先锋 与第一台电子计算机埃历阿克的命运相似&#xff0c;1974 年面世的“牛郎星”能否作为世界上第一台微电脑被载入史册&#xff0c;人们似乎也存在着分歧。 拥有微处理器发明权的英特尔公司&#xff0c;难道自己不会组装微电脑&#xff0c;非得罗伯茨来越俎代庖吗&…

从零开始:C++ String类的模拟实现

文章目录 引言1.类的基本结构2.构造函数和析构函数3.基本成员函数总结 引言 在C编程中&#xff0c;字符串操作是非常常见且重要的任务。标准库中的std::string类提供了丰富且强大的功能&#xff0c;使得字符串处理变得相对简单。然而&#xff0c;对于学习C的开发者来说&#x…

【考研数学】强化阶段,张宇《1000题》正确率达到多少算合格?

首次正确率在60%以上就算是合格&#xff01; 张宇老师的1000题真挺难的&#xff0c;所以如果第一次做正确率不高&#xff0c;不要太焦虑&#xff0c;1000题不管是难度&#xff0c;综合度还是计算量&#xff0c;都比其他的题集高一截。 大家真实的做题情况下&#xff0c;如果正…

前端工程化 - 快速通关 - ES6

目录 ES6 1.1 let 1.2 const 1.3解构 1.4链判断 1.5参数默认值 1.6箭头函数 1.7模板字符串 1.8Promise 1.9Async 函数 1.10模块化 ES6 ●ECMAScript&#xff08;ES&#xff09; 是规范、 JavaScript 是 ES 的实现 ●ES6 的第一个版本 在 2015 年 6 月发布&#xff0c…

【C语言习题】12.扫雷游戏

文章目录 1.扫雷游戏分析和设计1.1 扫雷游戏的功能说明1.2游戏界面&#xff1a;1.3游戏的分析和设计1.2.1 数据结构的分析1.2.2 ⽂件结构设计 2.扫雷游戏的代码实现3.代码讲解 1.扫雷游戏分析和设计 1.1 扫雷游戏的功能说明 使用控制台实现经典的扫雷游戏游戏可以通过菜单实现…

机器学习案例:加州房产价格(四)

参考链接&#xff1a;https://hands1ml.apachecn.org/2/#_12 数据探索和可视化、发现规律 通过之前的工作&#xff0c;你只是快速查看了数据&#xff0c;对要处理的数据有了整体了解&#xff0c;现在的目标是更深的探索数据。 首先&#xff0c;保证你将测试集放在了一旁&…

特征模态分解(FMD):一种小众而又新颖的分解方法

​ 声明&#xff1a;文章是从本人公众号中复制而来&#xff0c;因此&#xff0c;想最新最快了解各类智能优化算法及其改进的朋友&#xff0c;可关注我的公众号&#xff1a;强盛机器学习&#xff0c;不定期会有很多免费代码分享~ 今天为大家介绍一个小众而又新颖的信号分…

HyperLogLog的使用做UV统计

使用Jedis连接Redis并操作HyperLogLog import redis.clients.jedis.Jedis;public class RedisHyperLogLogExample {public static void main(String[] args) {// 连接到本地的Redis服务Jedis jedis new Jedis("localhost", 6379);String hyperLogLogKey "hll…

智慧安防系统:构建更安全的社区环境

随着科技的不断进步&#xff0c;人们的生活质量得到了显著提高。然而&#xff0c;与此同时&#xff0c;社会治安问题也日益凸显。为了维护社会的和谐稳定&#xff0c;提高人们的生活安全感&#xff0c;智慧安防系统应运而生。本文将为您详细介绍智慧安防系统的项目背景、需求分…

默认成员函数:析构、深浅拷贝

析构函数 析构函数&#xff1a;与构造函数功能相反&#xff0c;析构函数不是完成对对象本身的销毁&#xff0c;局部对象销毁工作是由编译器完成的。而对象在销毁时会自动调用析构函数&#xff0c;完成对象中资源的清理工作。 特性 析构函数名时在类名前面加上字符~ class D…