Arduino - 按钮 - 长按短按

Arduino - Button - Long Press Short Press Arduino - 按钮 - 长按短按

Arduino - Button - Long Press Short Press

We will learn: 我们将学习:

  • How to detect the button’s short press
    如何检测按钮的短按
  • How to detect the button’s long press
    如何检测按钮的长按
  • How to detect both the button’s long press and short press
    如何检测按钮的长按和短按
  • Long press and short press with debouncing
    长按和短按带去弹跳

In the first three parts, we learn how to detect in principle.
在前三部分中,我们学习了如何原则上进行检测。

In the last part, we learn how to detect in practical use by applying the debounce. See why do we need to debounce for button. Without debouncing, we may detect wrong the button short press.
在最后一部分中,我们将学习如何通过应用去抖动来检测实际使用中的检测。看看为什么我们需要为按钮去抖动。如果不去抖动,我们可能会检测到错误的按钮短按。

Hardware Required 所需硬件

1×Arduino UNO or Genuino UNO Arduino UNO 或 Genuino UNO
1×USB 2.0 cable type A/B USB 2.0 电缆 A/B 型
1×Push Button 按钮
1×(Optional) Panel-mount Push Button (可选)面板安装按钮
1×Breadboard 面包板
1×Jumper Wires 跳线
1×(Optional) 9V Power Adapter for Arduino (可选)用于Arduino的9V电源适配器
1×(Recommended) Screw Terminal Block Shield for Arduino Uno (推荐)用于Arduino Uno的螺钉接线端子屏蔽层
1×(Optional) Transparent Acrylic Enclosure For Arduino Uno (可选)Arduino Uno透明亚克力外壳

About Button 关于按钮

If you do not know about button (pinout, how it works, how to program …), learn about them in the following tutorials:
如果您不了解按钮(引脚排列、工作原理、如何编程等),请在以下教程中了解它们:

  • Arduino - Button tutorial
    Arduino - 按钮教程

Wiring Diagram 接线图

Arduino Button Wiring Diagram

In this tutorial, we will use the internal pull-up resistor. Therefore, the state of the button is HIGH when normal and LOW when pressed.
在本教程中,我们将使用内部上拉电阻。因此,按钮的状态在正常时为高电平,按下时为低电平。

How To Detect Short Press 如何检测短按

We measure the time duration between the pressed and released events. If the duration is shorter than a defined time, the short press event is detected.
我们测量按下和发布事件之间的持续时间。如果持续时间短于定义的时间,则检测短按事件。

Let’s see step by step:
让我们一步一步地看:

  • Define how long the maximum of short press lasts
    定义短按的最大持续时间
const int SHORT_PRESS_TIME = 500; // 500 milliseconds 
  • Detect the button is pressed and save the pressed time
    检测按钮是否被按下并保存按下时间
if(lastState == HIGH && currentState == LOW)pressedTime = millis(); 
  • Detect the button is released and save the released time
    检测按钮已释放并保存释放时间
if(lastState == LOW && currentState == HIGH)releasedTime = millis(); 
  • Calculate press duration and
    计算按压持续时间和
long pressDuration = releasedTime - pressedTime; 
  • Determine the short press by comparing the press duration with the defined short press time.
    通过将按压持续时间与定义的短按压时间进行比较来确定短按。
if( pressDuration < SHORT_PRESS_TIME )  Serial.println("A short press is detected"); 

Arduino Code for detecting the short press 用于检测短按的Arduino代码

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int SHORT_PRESS_TIME = 500; // 500 milliseconds// Variables will change:
int lastState = LOW;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;void setup() {Serial.begin(9600);pinMode(BUTTON_PIN, INPUT_PULLUP);
}void loop() {// read the state of the switch/button:currentState = digitalRead(BUTTON_PIN);if(lastState == HIGH && currentState == LOW)        // button is pressedpressedTime = millis();else if(lastState == LOW && currentState == HIGH) { // button is releasedreleasedTime = millis();long pressDuration = releasedTime - pressedTime;if( pressDuration < SHORT_PRESS_TIME )Serial.println("A short press is detected");}// save the the last statelastState = currentState;
}
Quick Steps 快速步骤
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Press the button shortly several times.
    短按按钮几次。
  • See the result on Serial Monitor
    在串行监视器上查看结果

※ NOTE THAT: ※ 注意事项:

The Serial Monitor may show several short press detection for one press. This is the normal behavior of the button. This behavior is called the “chattering phenomenon”. The issue will be solved in the last part of this tutorial.
串行监视器可能会显示一次按下的几次短按检测。这是按钮的正常行为。这种行为被称为“颤动现象”。该问题将在本教程的最后一部分解决。

How To Detect Long Press 如何检测长按

There are two use cases for detecting the long press.
检测长按有两个用例。

  • The long-press event is detected right after the button is released
    释放按钮后立即检测到长按事件
  • The long-press event is detected during the time the button is being pressed, even the button is not released yet.
    在按下按钮期间检测到长按事件,甚至按钮尚未松开。

In the first use case, We measure the time duration between the pressed and released events. If the duration is longer than a defined time, the long-press event is detected.
在第一个用例中,我们测量按下和发布事件之间的持续时间。如果持续时间超过定义的时间,则检测长按事件。

In the second use case, After the button is pressed, We continuously measure the pressing time and check the long-press event until the button is released. During the time button is being pressed. If the duration is longer than a defined time, the long-press event is detected.
在第二个用例中,按下按钮后,我们连续测量按下时间并检查长按事件,直到释放按钮。在按下时间按钮期间。如果持续时间超过定义的时间,则检测长按事件。

Arduino Code for detecting long press when released Arduino代码,用于在释放时检测长按

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int LONG_PRESS_TIME  = 1000; // 1000 milliseconds// Variables will change:
int lastState = LOW;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;void setup() {Serial.begin(9600);pinMode(BUTTON_PIN, INPUT_PULLUP);
}void loop() {// read the state of the switch/button:currentState = digitalRead(BUTTON_PIN);if(lastState == HIGH && currentState == LOW)        // button is pressedpressedTime = millis();else if(lastState == LOW && currentState == HIGH) { // button is releasedreleasedTime = millis();long pressDuration = releasedTime - pressedTime;if( pressDuration > LONG_PRESS_TIME )Serial.println("A long press is detected");}// save the the last statelastState = currentState;
}
Quick Steps 快速步骤
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Press and release the button after one second.
    一秒钟后按下并松开按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

The long-press event is only detected right after the button is released
只有在释放按钮后才能检测到长按事件

Arduino Code for detecting long press during pressing 用于在按压过程中检测长按的Arduino代码

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int LONG_PRESS_TIME  = 1000; // 1000 milliseconds// Variables will change:
int lastState = LOW;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
bool isPressing = false;
bool isLongDetected = false;void setup() {Serial.begin(9600);pinMode(BUTTON_PIN, INPUT_PULLUP);
}void loop() {// read the state of the switch/button:currentState = digitalRead(BUTTON_PIN);if(lastState == HIGH && currentState == LOW) {        // button is pressedpressedTime = millis();isPressing = true;isLongDetected = false;} else if(lastState == LOW && currentState == HIGH) { // button is releasedisPressing = false;}if(isPressing == true && isLongDetected == false) {long pressDuration = millis() - pressedTime;if( pressDuration > LONG_PRESS_TIME ) {Serial.println("A long press is detected");isLongDetected = true;}}// save the the last statelastState = currentState;
}
Quick Steps 快速步骤
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Press and release the button after several seconds.
    几秒钟后按下并松开按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

How To Detect Both Long Press and Short Press 如何检测长按和短按

Short Press and Long Press after released 发布后短按和长按

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int SHORT_PRESS_TIME = 1000; // 1000 milliseconds
const int LONG_PRESS_TIME  = 1000; // 1000 milliseconds// Variables will change:
int lastState = LOW;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;void setup() {Serial.begin(9600);pinMode(BUTTON_PIN, INPUT_PULLUP);
}void loop() {// read the state of the switch/button:currentState = digitalRead(BUTTON_PIN);if(lastState == HIGH && currentState == LOW)        // button is pressedpressedTime = millis();else if(lastState == LOW && currentState == HIGH) { // button is releasedreleasedTime = millis();long pressDuration = releasedTime - pressedTime;if( pressDuration < SHORT_PRESS_TIME )Serial.println("A short press is detected");if( pressDuration > LONG_PRESS_TIME )Serial.println("A long press is detected");}// save the the last statelastState = currentState;
}
Quick Steps 快速步骤
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Long and short press the button.
    长按和短按按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

※ NOTE THAT: ※ 注意事项:

The Serial Monitor may show several short press detection when long press. This is the normal behavior of the button. This behavior is called the “chattering phenomenon”. The issue will be solved in the last part of this tutorial.
长按时,串行监视器可能会显示几次短按检测。这是按钮的正常行为。这种行为被称为“颤动现象”。该问题将在本教程的最后一部分解决。

Short Press and Long Press During pressing 短按和长按 按压过程中

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
const int SHORT_PRESS_TIME = 1000; // 1000 milliseconds
const int LONG_PRESS_TIME  = 1000; // 1000 milliseconds// Variables will change:
int lastState = LOW;  // the previous state from the input pin
int currentState;     // the current reading from the input pin
unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;
bool isPressing = false;
bool isLongDetected = false;void setup() {Serial.begin(9600);pinMode(BUTTON_PIN, INPUT_PULLUP);
}void loop() {// read the state of the switch/button:currentState = digitalRead(BUTTON_PIN);if(lastState == HIGH && currentState == LOW) {        // button is pressedpressedTime = millis();isPressing = true;isLongDetected = false;} else if(lastState == LOW && currentState == HIGH) { // button is releasedisPressing = false;releasedTime = millis();long pressDuration = releasedTime - pressedTime;if( pressDuration < SHORT_PRESS_TIME )Serial.println("A short press is detected");}if(isPressing == true && isLongDetected == false) {long pressDuration = millis() - pressedTime;if( pressDuration > LONG_PRESS_TIME ) {Serial.println("A long press is detected");isLongDetected = true;}}// save the the last statelastState = currentState;
}
Quick Steps 快速步骤
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Long and short press the button.
    长按和短按按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

※ NOTE THAT: ※ 注意事项:

The Serial Monitor may show several short press detection when long press. This is the normal behavior of the button. This behavior is called the “chattering phenomenon”. The issue will be solved in the last part of this tutorial.
长按时,串行监视器可能会显示几次短按检测。这是按钮的正常行为。这种行为被称为“颤动现象”。该问题将在本教程的最后一部分解决。

Long Press and Short Press with Debouncing 长按和短按带去弹跳

It is very important to debounce the button in many applications.
在许多应用中,对按钮进行去抖动非常重要。

Debouncing is a little complicated, especially when using multiple buttons. To make it much easier for beginners, we created a library, called ezButton.
去抖动有点复杂,尤其是在使用多个按钮时。为了让初学者更容易,我们创建了一个名为 ezButton 的库。

We will use this library in below codes
我们将在下面的代码中使用这个库

Short Press and Long Press with debouncing after released 短按和长按,释放后去弹跳

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/#include <ezButton.h>const int SHORT_PRESS_TIME = 1000; // 1000 milliseconds
const int LONG_PRESS_TIME  = 1000; // 1000 millisecondsezButton button(7);  // create ezButton object that attach to pin 7;unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;void setup() {Serial.begin(9600);button.setDebounceTime(50); // set debounce time to 50 milliseconds
}void loop() {button.loop(); // MUST call the loop() function firstif(button.isPressed())pressedTime = millis();if(button.isReleased()) {releasedTime = millis();​    long pressDuration = releasedTime - pressedTime;​    if( pressDuration < SHORT_PRESS_TIME )
​      Serial.println("A short press is detected");​    if( pressDuration > LONG_PRESS_TIME )
​      Serial.println("A long press is detected");}
}
Quick Steps 快速步骤
  • Install ezButton library. See How To
    安装 ezButton 库。了解操作方法
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Long and short press the button.
    长按和短按按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

Short Press and Long Press with debouncing During Pressing 短按和长按,按压过程中去弹跳

/** Created by ArduinoGetStarted.com** This example code is in the public domain** Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press*/#include <ezButton.h>const int SHORT_PRESS_TIME = 1000; // 1000 milliseconds
const int LONG_PRESS_TIME  = 1000; // 1000 millisecondsezButton button(7);  // create ezButton object that attach to pin 7;unsigned long pressedTime  = 0;
unsigned long releasedTime = 0;
bool isPressing = false;
bool isLongDetected = false;void setup() {Serial.begin(9600);button.setDebounceTime(50); // set debounce time to 50 milliseconds
}void loop() {button.loop(); // MUST call the loop() function firstif(button.isPressed()){pressedTime = millis();isPressing = true;isLongDetected = false;}if(button.isReleased()) {isPressing = false;releasedTime = millis();long pressDuration = releasedTime - pressedTime;if( pressDuration < SHORT_PRESS_TIME )Serial.println("A short press is detected");}if(isPressing == true && isLongDetected == false) {long pressDuration = millis() - pressedTime;if( pressDuration > LONG_PRESS_TIME ) {Serial.println("A long press is detected");isLongDetected = true;}}
}
Quick Steps 快速步骤
  • Install ezButton library. See How To
    安装 ezButton 库。了解操作方法
  • Upload the above code to Arduino via Arduino IDE
    通过Arduino IDE将上述代码上传到Arduino
  • Long and short press the button.
    长按和短按按钮。
  • See the result on Serial Monitor
    在串行监视器上查看结果

Video Tutorial 视频教程

We are considering to make the video tutorials. If you think the video tutorials are essential, please subscribe to our YouTube channel to give us motivation for making the videos.
我们正在考虑制作视频教程。如果您认为视频教程是必不可少的,请订阅我们的 YouTube 频道,为我们制作视频提供动力。

Why Needs Long Press and Short Press 为什么需要长按和短按

  • To save the number of buttons. A single button can keep two or more functionalities. For example, short press for changing operation mode, long press for turn off the device.
    保存按钮数量。一个按钮可以保留两个或多个功能。例如,短按可更改操作模式,长按可关闭设备。
  • Use of long press to reduce the short press by accident. For example, some kinds of devices use the button for factory reset. If the button is pressed by accident, it is dangerous. To avoid it, the device is implemented to be factory reset only when the button is long-press (e.g over 5 seconds)
    使用长按减少意外短按。例如,有些设备使用按钮进行出厂重置。如果意外按下按钮,就会造成危险。为了避免这种情况,设备只有在长按按钮(例如超过 5 秒)时才能进行出厂重置。

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

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

相关文章

重大进展!微信支付收款码全场景接入银联网络

据中国银联6月19日消息&#xff0c;近日&#xff0c;银联网络迎来微信支付收款码场景的全面接入&#xff0c;推动条码支付互联互通取得新进展&#xff0c;为境内外广大消费者提供更多支付选择、更好支付体验。 2024年6月&#xff0c;伴随微信支付经营收款码的开放&#xff0c;微…

Rust: duckdb和polars读csv文件比较

一、文件准备 样本内容&#xff0c;N行9列的csv标准格式&#xff0c;有字符串&#xff0c;有浮点数&#xff0c;有整型。 有两个csv文件&#xff0c;一个大约是2.1万行&#xff1b;一个是64万行。 二、toml文件 [package] name "my_duckdb" version "0.1.0&…

VSCode安装OpenImageDebugger

VSCode安装OpenImageDebugger 1. 官网2. 编译2.1 依赖项2.2 编译 OpenImageDebugger2.3 配置 GDB 和 LLDB 3. 验证安装是否成功 1. 官网 下载路径&#xff1a;OpenImageDebugger 2. 编译 2.1 依赖项 官网上描述&#xff0c; Qt 5.15.1Python 3.10.12 这两个其实配置并不需…

图解HTTP笔记整理(前六章)

图解HTTP 第一章 web使用HTTP &#xff08;HyperText Transfer Protocol&#xff0c;超文本传输协议&#xff09;协议作文规范&#xff0c;完成从客户端到服务器端等一系列运作流程。 协议&#xff1a;计算机与网络设备要相互通信&#xff0c;双方就必须基于相同的方法。比如…

【论文阅读】--Popup-Plots: Warping Temporal Data Visualization

弹出图&#xff1a;扭曲时态数据可视化 摘要1 引言2 相关工作3 弹出图3.1 椭球模型3.1.1 水平轨迹3.1.2 垂直轨迹3.1.3 组合轨迹 3.2 视觉映射与交互 4 实施5 结果6 评估7 讨论8 结论和未来工作致谢参考文献 期刊: IEEE Trans. Vis. Comput. Graph.&#xff08;发表日期: 2019&…

HQChart使用教程30-K线图如何对接第3方数据41-分钟K线叠加股票增量更新

HQChart使用教程30-K线图如何对接第3方数据40-日K叠加股票增量更新 叠加股票叠加分钟K线更新Request 字段说明Data.symbol 协议截图返回json数据结构overlaydata HQChart代码地址交流 叠加股票 示例地址:https://jones2000.github.io/HQChart/webhqchart.demo/samples/kline_i…

可以一键生成热点营销视频的工具,建议收藏

在当今的商业环境中&#xff0c;热点营销已经成为了一种非常重要的营销策略。那么&#xff0c;什么是热点营销呢&#xff1f;又怎么做热点营销视频呢&#xff1f; 最近高考成绩慢慢公布了&#xff0c;领导让结合“高考成绩公布”这个热点&#xff0c;做一个关于企业或产品的营销…

鸿蒙NEXT开发:工具常用命令—install

安装三方库。 命令格式 ohpm install [options] [[<group>/]<pkg>[<version> | tag:<tag>]] ... ohpm install [options] <folder> ohpm install [options] <har file> alias: i 说明 group&#xff1a;三方库的命名空间&#xff0c;可…

sys.stdin对象——实现标准输入

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 语法参考 sys.stdin是一个标准化输入对象&#xff0c;可以连续输入或读入文件所有内容&#xff0c;不结束&#xff0c;不能直接使用。输入完成后&am…

print()函数——打印输出

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 print()函数是Python编程最常见的函数&#xff0c;常用于输出程序结果&#xff0c;默认输出到屏幕&#xff0c;也可以输出到指定文件。 语法参考 pr…

吉他谱制作软件哪个好 吉他弹唱谱制作软件推荐

在市面上存在着多种吉他谱制作软件&#xff0c;如何选择一款适合自己需求的软件成为了许多人面临的挑战。下面来看看吉他谱制作软件哪个好&#xff0c;吉他弹唱谱制作软件推荐的相关内容。 一、吉他谱制作软件哪个好 吉他谱制作软件在现代音乐创作中扮演着重要角色&#xff0c…

调频信号FM的原理与matlab与FPGA实现

平台&#xff1a;matlab r2021b&#xff0c;vivado2023.1 本文知识内容摘自《软件无线电原理和应用》 调频(FM)是载波的瞬时频率随调制信号成线性变化的一种调制方式&#xff0c;音频调频信号的数学表达式可以写为&#xff1a; Fm频率调制&#xff0c;载波的幅度随着调制波形…

open()函数——打开文件并返回文件对象

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 open()函数用于打开文件&#xff0c;返回一个文件读写对象&#xff0c;然后可以对文件进行相应读写操作。 语法参考 open()函数的语法格式如下&…

【K8s】专题六(2):Kubernetes 稳定性之健康检查

以下内容均来自个人笔记并重新梳理&#xff0c;如有错误欢迎指正&#xff01;如果对您有帮助&#xff0c;烦请点赞、关注、转发&#xff01;欢迎扫码关注个人公众号&#xff01; 目录 一、基本介绍 二、工作原理 三、探针类型 1、存活探针&#xff08;LivenessProbe&#x…

docker入门配置

1、创建配置镜像 由于国内docker连接外网速度慢&#xff0c;采用代理 vi /etc/docker/daemon.json添加以下内容 {"registry-mirrors": ["https://9cpn8tt6.mirror.aliyuncs.com","https://dockerproxy.com","https://hub-mirror.c.163.co…

SOA和ESB介绍

SOA&#xff08;面向服务的架构&#xff09; 面向服务的架构&#xff08;Service-Oriented Architecture&#xff0c;SOA&#xff09;是一种设计理念&#xff0c;用于构建松耦合的、可互操作的、模块化的服务。在SOA架构中&#xff0c;应用程序被划分为一系列的服务&#xff0c…

电脑屏幕花屏怎么办?5个方法解决问题!

“我刚刚打开电脑就发现我的电脑屏幕出现了花屏的情况。这让我很困惑&#xff0c;我应该怎么解决这个问题呢&#xff1f;求帮助。” 在这个数字时代的浪潮中&#xff0c;电脑早已成为我们生活中不可或缺的一部分。然而&#xff0c;当你正沉浸在紧张的游戏对战中&#xff0c;或是…

谷歌上搞下来的,无需付费,可以收藏!

在数字化时代&#xff0c;我们越来越依赖于智能设备来获取信息和知识。中国智谋App正是这样一款应用&#xff0c;它将中国古代的智慧与谋略书籍带入了我们的移动设备&#xff0c;让我们能够随时随地学习和领悟。而且提供文言文的原文和译文。 软件下载方式&#xff1a;谷歌上搞…

39.右键弹出菜单管理游戏列表

上一个内容&#xff1a;38.控制功能实现 以 ​​​​​​​ 38.控制功能实现 它的代码为基础进行修改 效果图&#xff1a; 点击设置之后的样子 点击删除 点击删除之后的样子 实现步骤&#xff1a; 首先添加一个菜单资源&#xff0c;右击项目资源选择下图红框 然后选择Menu 然…

【C语言】字符/字符串+内存函数

目录 Ⅰ、字符函数和字符串函数 1 .strlen 2.strcpy 3.strcat 4.strcmp 5.strncpy 6.strncat 7.strncmp 8.strstr 9.strtok 10.strerror 11.字符函数 12. 字符转换函数 Ⅱ、内存函数 1 .memcpy 2.memmove 3.memcmp Ⅰ、字符函数和字符串函数 1 .strlen 函数原型&#xff1a;…