当前位置:网站首页>Design skills of main function of Blue Bridge Cup single chip microcomputer
Design skills of main function of Blue Bridge Cup single chip microcomputer
2022-06-27 14:22:00 【Old man in charge】
Main function structure design :
#include <main.h>//unsigned char time_fage_n=0;unsigned char time_flag_0=0;//bit name_mode_flag=0;bit mode_flag=0;bit ad_mode_flag=0;bit led_mode_flag=0;bit smg_mode_flag=0;//dat_para_setunsigned char da_para;void main(){//name_mode_init();Timer2Init(); // Timer 2 initialization , timing 2mssmg_init(); // Nixie tube initialization , Namely blanking board_init(); // Relay , Buzzer initialization ( close )led_init(); //led initialization ( Extinguish all )while(1) // Into the loop {/* Time slice cycle *//* Use timer interrupt to generate a certain time slice cycle , And execute a specific function during the cycle . Which uses time_flag_n++ To generate a cycle time slice *//* utilize time_flag_n%para Is in time_flag_n Execute the function multiple times before clearing *//* utilize time_flag_n==para Is in time_flag_n Execute only once before clearing , Different parameters separate the execution time of different functions *//* Use different time_flag Multiple different cycles can be generated , Make the functions executed in each cycle isolated from each other , No interference *///key_scanif(time_flag_0%5==0){key_scan(); // Every time 10ms One key scan }//da_out_and_ad_in/* Bear in mind , If the program needs digital to analog conversion or analog-to-digital conversion at the same time , Please put the two functions together , Otherwise, the risk of digital to analog conversion failure will occur , And if the time between two functions is longer &#x边栏推荐
- The global chip market may stagnate, and China's chip expansion accelerates to improve its self-sufficiency rate against the trend
- Axi bus
- Number of printouts (solved by recursive method)
- Domestic database disorder
- In the past, domestic mobile phones were arrogant in pricing and threatened that consumers would like to buy or not, but now they have plummeted by 2000 for sale
- 基于WEB平台的阅读APP设计与实现
- Overseas warehouse knowledge popularization
- Redis master-slave replication, sentinel mode, cluster cluster
- External memory
- 解析Activity启动-生命周期角度
猜你喜欢

enable_ if

【业务安全-02】业务数据安全测试及商品订购数量篡改实例

Pytorch learning 1 (learning documents on the official website)

External memory

AXI總線

EventLoop learning
![[advanced MySQL] MTS master-slave synchronization principle and Practice Guide (7)](/img/d6/1b916f49ad02dee4ab2c26add324df.png)
[advanced MySQL] MTS master-slave synchronization principle and Practice Guide (7)

Array related knowledge

Design and implementation of reading app based on Web Platform

Completely solve the problem of Chinese garbled code in Web Engineering at one time
随机推荐
[安洵杯 2019]Attack
Naacl 2022 | TAMT: search the transportable Bert subnet through downstream task independent mask training
Bidding announcement: Oracle all-in-one machine software and hardware maintenance project of Shanghai R & D Public Service Platform Management Center
Kyndryl partnered with Oracle and Veritas
AXI总线
机械硬盘和ssd固态硬盘的原理对比分析
Summary and Thinking on interface test automation
类模板中可变参的逐步展开
Axi bus
【PHP代码注入】PHP语言常见可注入函数以及PHP代码注入漏洞的利用实例
enable_ if
Practice of constructing ten billion relationship knowledge map based on Nebula graph
全球芯片市场或陷入停滞,中国芯片逆势扩张加速提升自给率
Openssf security plan: SBOM will drive software supply chain security
A brief analysis of the differences between domestic and foreign e-commerce
国产数据库乱象
Daily question 3 (2): check binary string field
[XMAN2018排位赛]通行证
解析Activity启动-生命周期角度
Notes learning summary