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
#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,0XC6,0X39,0XC6,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B,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,0X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7B,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,0X9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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);
  }
}

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

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

JETBRAINS IDES 分享一个2099通用试用码,支持一键升级!CLion 2024 版

文章目录 废话不多说上教程&#xff1a;&#xff08;动画教程 图文教程&#xff09;一、动画教程激活 与 升级&#xff08;至最新版本&#xff09; 二、图文教程 &#xff08;推荐&#xff09;Stage 1.下载安装 toolbox-app&#xff08;全家桶管理工具&#xff09;Stage 2 : 下…

一直可以正常 git push 代码,突然就不行了,提示端口22错误,访问超时!

大家好&#xff0c;我是 Just&#xff0c;这里是「设计师工作日常」&#xff0c;今天分享的是当使用 git 时&#xff0c;突然提示端口错误&#xff0c;然后访问超时&#xff0c;我解决的过程以及最后的解决方案。 最新文章通过公众号「设计师工作日常」发布。 目录 不好意思&a…

手撕C语言题典——环形链表的约瑟夫问题

目录 前言 一.故事背景 二.题目 ​编辑三.思路 1&#xff09;数组 ​编辑2&#xff09; 循环链表 四.代码实现 搭配食用更佳哦~~ 数据结构之单单单——链表-CSDN博客 数据结构之单链表的基本操作-CSDN博客 前面学了单链表的相关知识&#xff0c;我们来尝试做一下关于…

用友hr软件统一认证与致远OA单点登录身份周期管理怎么做

一、引言 随着企业信息化建设的深入&#xff0c;各类管理软件如用友HR、致远OA等已经成为事业单位日常运营不可或缺的工具。用友HR软件以其强大的人力资源管理功能&#xff0c;帮助企事业单位实现员工信息的集中管理&#xff1b;而致远OA则以其便捷的办公流程管理&#xff0c;…

数据中心网络随想-电路交换

数据中心网络扩容并不容易&#xff0c;涉及设备上架&#xff0c;切换等又硬又大的动作&#xff0c;期间对所有应用都会产生影响&#xff0c;所以理论上 “加钱加硬件” 这种看起来很简单的事实际上真不如 “写一个随时部署升级的端到端拥塞控制算法” 更容易实施。 傍晚绕小区…

【以规划为导向的自动驾驶】Planning-oriented Autonomous Driving

ABSTRACT 研究背景&#xff1a; 现代自动驾驶系统是顺序化地排列多个任务模块, 近期的主流方法&#xff1a; ①为单个任务部署独立模型 ②设计具有分离式头部的多任务(multi-task)范式。 但是&#xff0c;这些方法会累积误差或任务间协同不足而不利于自动驾驶。 作者认为重…

nginx 配置域名SSL证书HTTPS服务

下载 上传根目录 /home/wwwroot/xx.com/ssl 从新执行 添加域名命令 选择添加SSL SSL Certificate file: 填写 完整目录 PEM文件地址 SSL Certificate Key file:填写 完整目录 key文件地址

鸿蒙布局Column/Row/Stack

鸿蒙布局Column/Row/Stack 简介我们以Column为例进行讲解1. Column({space: 10}) 这里的space: 10&#xff0c;表示Column里面每个元素之间的间距为102. width(100%)&#xff0c;height(100%) 表示宽高占比3. backgroundColor(0xffeeeeee) 设置背景颜色4. padding({top: 50}) 设…

如何用Rust获取本机CPU、内存在Web网页中显示?

目录 一、需求描述 二、具体操作步骤 三、知识点 1、systemstat 2、Actix 一、需求描述 需求&#xff1a; 1、需要使用Rust进行后端开发获取本机CPU和内存信息&#xff1b; 2、使用WEB框架发布API&#xff1b; 3、然后使用HTML/CSS/JavaScript进行前端开发&#xff0…

网络安全公司观察,看F5如何将安全化繁为简

应用无处不在的当下&#xff0c;从传统应用到现代应用再到边缘、多云、多中心的安全防护&#xff0c;安全已成为企业数字化转型中的首要挑战。根据IDC2023年《全球网络安全支出指南》&#xff0c;2022年度中国网络安全支出规模137.6亿美元&#xff0c;增速位列全球第一。有专家…

ICode国际青少年编程竞赛- Python-6级训练场-多重递归

ICode国际青少年编程竞赛- Python-6级训练场-多重递归 1、 def move(a, b):if a > 12:returnDev.step(a)Dev.turnRight()if b < 4:move(a, b1)else:move(a2, 1) move(2, 1)2、 def move(a, b):if a < 2:returnif b 1: Spaceship.step(2)Dev.step(a)Dev.turnRight()De…

静态住宅IP优缺点总结

在进行海外 IP 代理时&#xff0c;了解动态住宅 IP 和静态住宅 IP 的区别以及如何选择合适的类型非常重要。本文将介绍精态住宅 IP 特点和&#xff0c;并提供选择建议&#xff0c;帮助您根据需求做出明智的决策。 静态住宅 IP 的特点 静态住宅 IP 是指 IP 地址在一段时间内保…

idea启动Jsp非maven项目时的一些步骤

文章目录 事前准备eclipse项目举例idea打开eclipse项目安装tomcat配置启动项启动测试 一些小问题到不到servlet 事前准备 非社区版idea【否则启动项无法配置】tomcatmysql eclipse项目举例 idea打开eclipse项目 剩下的全部下一步即可 安装tomcat 自己的文章 Javaweb - t…

GPT-4o: 从最难的“大海捞针”基准看起

大模型技术论文不断&#xff0c;每个月总会新增上千篇。本专栏精选论文重点解读&#xff0c;主题还是围绕着行业实践和工程量产。若在阅读过程中有些知识点存在盲区&#xff0c;可以回到如何优雅的谈论大模型重新阅读。另外斯坦福2024人工智能报告解读为通识性读物。若对于如果…

免费PPT模板下载,无套路。

身在职场做好PPT是一项必备技能&#xff0c;如何快速做出好看又高级的PPT&#xff0c;收藏好这6个网站&#xff0c;不管你是工作总结、毕业论文、个人简历、企业宣传都能找到合适的模板&#xff0c;最重要的是可以免费下载。 1、菜鸟图库 ppt模板免费下载|ppt背景图片 - 菜鸟图…

轻松拿下指针(5)

文章目录 一、回调函数是什么二、qsort使用举例三、qsort函数的模拟实现 一、回调函数是什么 回调函数就是⼀个通过函数指针调⽤的函数。 如果你把函数的指针&#xff08;地址&#xff09;作为参数传递给另⼀个函数&#xff0c;当这个指针被⽤来调⽤其所指向的函数 时&#x…

晶振在电子设备中的作用是什么?

在无源晶振电路中&#xff0c;并联电阻起着至关重要的作用。无源晶振本身不能自行产生振荡&#xff0c;因此需要借助外部电路来实现。并联在晶振两端的电阻&#xff0c;通常称为负载电阻&#xff0c;对电路的稳定性和振荡性能有着重要影响。 晶振电路的核心是皮尔斯振荡器&…

同城预约上门服务家政小程序

基于Thinkphp和原生微信小程序开发的一款同城预约、上门服务、到店核销家政系统&#xff0c;用户端、服务端、门店端各端相互依赖又相互独立&#xff0c;支持选择项目、选择服务人员、选择门店多种下单方式&#xff0c;支持上门服务和到店核销两种服务方式&#xff0c;支持自营…

java AOP环绕切面记录操作日志

一.创建数据库日志表 CREATE TABLE uc_system_log (id bigint(20) NOT NULL AUTO_INCREMENT COMMENT 主键ID,user_code varchar(64) DEFAULT NULL COMMENT 用户编码,user_name varchar(128) DEFAULT NULL COMMENT 用户名称,is_login tinyint(4) NOT NULL DEFAULT 0 COMMENT 是…

Oracle到PostgreSQL的不停机数据库迁移

1970 年&#xff0c;数据库之父 Edgar Frank Codd 发表了“数据的关系模型”论文&#xff0c;该论文为往后的关系型数据库的发展奠定了基础。1979 年&#xff0c;基于关系模型理论的数据库产品 Oracle 2 首次亮相&#xff0c;并在过去的三四十年时间里&#xff0c;横扫全球数据…