当前位置:网站首页>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边栏推荐
- 力扣 第 81 场双周赛
- Resolve activity startup - lifecycle Perspective
- 高德地图IP定位2.0备份
- 每日3题(2):检查二进制字符串字段
- 每日3题(1):找到最近的有相同 X 或 Y 坐标的点
- Acwing game 57
- [advanced mathematics] from normal vector to surface integral of the second kind
- Interpretation of new version features of PostgreSQL 15 (including live Q & A and PPT data summary)
- 【PHP代码注入】PHP语言常见可注入函数以及PHP代码注入漏洞的利用实例
- [a complete human-computer interface program framework]
猜你喜欢

全球芯片市场或陷入停滞,中国芯片逆势扩张加速提升自给率

Kyndryl partnered with Oracle and Veritas

Naacl 2022 | TAMT: search the transportable Bert subnet through downstream task independent mask training

基于WEB平台的阅读APP设计与实现

以前国产手机高傲定价扬言消费者爱买不买,现在猛降两千求售

Completely solve the problem of Chinese garbled code in Web Engineering at one time

enable_if

Pytoch learning 2 (CNN)

AutoCAD - line width setting

美国芯片再遭重击,继Intel后又一家芯片企业将被中国芯片超越
随机推荐
Kyndryl partnered with Oracle and Veritas
基于SSM的Web网页聊天室系统
Pytorch learning 3 (test training model)
跨境电商多商户系统怎么选
反射学习总结
Integration of entry-level SSM framework based on XML configuration file
[安洵杯 2019]Attack
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
Interpretation of new version features of PostgreSQL 15 (including live Q & A and PPT data summary)
每日3题(1):找到最近的有相同 X 或 Y 坐标的点
Is there any discount for opening an account now? Is it safe to open an account online?
招标公告:上海市研发公共服务平台管理中心Oracle一体机软硬件维保项目
QT 如何在背景图中将部分区域设置为透明
High efficiency exponentiation
【业务安全-02】业务数据安全测试及商品订购数量篡改实例
Li Kou's 81st biweekly match
【高等数学】从法向量到第二类曲面积分
Web chat room system based on SSM
清华&商汤&上海AI&CUHK提出Siamese Image Modeling,兼具linear probing和密集预测性能!...
[daily 3 questions (3)] maximum number of balls in the box