当前位置:网站首页>Blue Bridge Cup multi interface switching processing (enumeration plus state machine method)
Blue Bridge Cup multi interface switching processing (enumeration plus state machine method)
2022-07-01 12:08:00 【Proficient in embedded】
List of articles
Preface
In this paper, we mainly introduce how to deal with the problem of multi interface switching in the Blue Bridge Cup .
One 、 What is multi interface switching
Multi interface switching is that the title requires a specific interface to be displayed in the case of characteristics , At this time, we need to switch the interface .
Two 、 Code display
#include <STC15F2K60S2.H>
static void DIP_ser(void)// Handling multiple interfaces
static void key_scan(void);// Press the key to switch the interface
typedef enum
{
ID_NULL=0,
ID_1,// Interface 1
ID_2,// Interface 2
ID_3,// Interface 3
}ID_DATA;
ID_DATA id_data;// Declare an enumeration variable
void DIP_ser(void)
{
switch(id_data)
{
case ID_1:
{
// Interface 1 Function main body
}
break;
case ID_2:
{
// Interface 2 Function main body
}
break;
case ID_3:
{
// Interface 3 Function main body
}
break;
}
}
void key_scan(void)
{
// Operate enumeration variables to achieve interface switching
( There is no need to explain this part of the code , Press the key to change id_data that will do )
}
void main()
{
id_data=ID_1;// Power on initialization interface 1( You can also change to other interfaces )
while(1)
{
key_scan();
DIP_ser();
}
}
summary
Using this method to switch the interface is simple and clear , The code will look clearer .
边栏推荐
- ABBIRB120工业机器人机械零点位置
- Adjacency matrix undirected graph (I) - basic concepts and C language
- 陈珙:微服务,它还那么纯粹吗?
- The operation process of using sugar to make a large data visualization screen
- LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制
- Self organization is the two-way rush of managers and members
- 91.(cesium篇)cesium火箭發射模擬
- NOV Schedule for . Net to display and organize appointments and recurring events
- Dataset partitioning script for classification tasks
- 【datawhale202206】pyTorch推荐系统:精排模型 DeepFM&DIN
猜你喜欢

Comment Cao définit la décimale de dimension

基于IMDB评论数据集的情感分析

谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征

The operation process of using sugar to make a large data visualization screen

Use set_ Handler filters out specific SystemC wrapping & error messages
![[106] 360 check font - check whether the copyright of local Fonts is commercially available](/img/a7/615e8000647b56f03a6a1d3dd81b6d.jpg)
[106] 360 check font - check whether the copyright of local Fonts is commercially available

GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021

Use of easyexcel

Summary of JFrame knowledge points 1

Virtualenv+pipenv virtual environment management
随机推荐
图的理论基础
Istio、eBPF 和 RSocket Broker:深入研究服务网格
力扣首页简介动画
On recursion and Fibonacci sequence
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
91.(cesium篇)cesium火箭發射模擬
耐克如何常年霸榜第一名?最新財報答案來了
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 8
Talk about biological live broadcast - genovis Zhang Hongyan antibody specific enzyme digestion technology helps to characterize the structure of antibody drugs
The Missing Semester
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
【datawhale202206】pyTorch推荐系统:召回模型 DSSM&YoutubeDNN
Acly and metabolic diseases
Value/hush in redis
Consolidate -c operator
Joint Time-Frequency and Time Domain Learning for Speech Enhancement
Value/list in redis
The specified service is marked for deletion
Chen Gong: Micro service, is it still so pure?
区间乘积的因子数之和——前缀和思想+定一移二