ZIP蓝桥杯单片机第十一届第二场省赛程序设计资源-基于西风模版 65.99KB

qq_50600028需要积分:9(1积分=1元)

资源文件列表:

蓝桥杯单片机十一届第二场省赛.zip 大约有30个文件
  1. 蓝桥杯单片机十一届第二场省赛/
  2. 蓝桥杯单片机十一届第二场省赛/202430202103.C 5.86KB
  3. 蓝桥杯单片机十一届第二场省赛/iic.c 1.89KB
  4. 蓝桥杯单片机十一届第二场省赛/iic.h 260B
  5. 蓝桥杯单片机十一届第二场省赛/Key.c 801B
  6. 蓝桥杯单片机十一届第二场省赛/Key.h 94B
  7. 蓝桥杯单片机十一届第二场省赛/Led.c 1.76KB
  8. 蓝桥杯单片机十一届第二场省赛/Led.h 288B
  9. 蓝桥杯单片机十一届第二场省赛/Listings/
  10. 蓝桥杯单片机十一届第二场省赛/Listings/202430202103.lst 11.45KB
  11. 蓝桥杯单片机十一届第二场省赛/Listings/iic.lst 4.53KB
  12. 蓝桥杯单片机十一届第二场省赛/Listings/Key.lst 2.19KB
  13. 蓝桥杯单片机十一届第二场省赛/Listings/Led.lst 4.81KB
  14. 蓝桥杯单片机十一届第二场省赛/Listings/model.m51 34.35KB
  15. 蓝桥杯单片机十一届第二场省赛/Listings/onewire.lst 3.09KB
  16. 蓝桥杯单片机十一届第二场省赛/model.uvgui.CCTT 90.92KB
  17. 蓝桥杯单片机十一届第二场省赛/model.uvopt 6.38KB
  18. 蓝桥杯单片机十一届第二场省赛/model.uvproj 14.62KB
  19. 蓝桥杯单片机十一届第二场省赛/Objects/
  20. 蓝桥杯单片机十一届第二场省赛/Objects/202430202103.obj 16.87KB
  21. 蓝桥杯单片机十一届第二场省赛/Objects/iic.obj 8.07KB
  22. 蓝桥杯单片机十一届第二场省赛/Objects/Key.obj 3.91KB
  23. 蓝桥杯单片机十一届第二场省赛/Objects/Led.obj 7.66KB
  24. 蓝桥杯单片机十一届第二场省赛/Objects/model 38.41KB
  25. 蓝桥杯单片机十一届第二场省赛/Objects/model.build_log.htm 1.27KB
  26. 蓝桥杯单片机十一届第二场省赛/Objects/model.hex 6.69KB
  27. 蓝桥杯单片机十一届第二场省赛/Objects/model.lnp 191B
  28. 蓝桥杯单片机十一届第二场省赛/Objects/onewire.obj 5.84KB
  29. 蓝桥杯单片机十一届第二场省赛/onewire.c 1.11KB
  30. 蓝桥杯单片机十一届第二场省赛/onewire.h 179B

资源介绍:

蓝桥杯单片机第十一届第二场省赛程序设计资源——基于西风模版
#include <STC15F2K60S2> #include "intrins.h" #include "onewire.h" #include "iic.h" #include "Led.h" #include "Key.h" /*****************************************************************/ /*****************************************************************/ //1.遇到离谱问题时请重新创建工程(上个工程中按键程序都写了break,还会执行到其他按键的功能) //2.L1老是闪烁,其他地方也没有更改L1的值 //2.已解决:因为初始把温度读取函数放在LED处理函数中,读取速度过快,导致数据不太稳定 unsigned char Seg_slow_down,Key_slow_down; //按键、数码管减速变量 unsigned char Key_down,Key_up,Key_old,Key_val; //按键读取变量 unsigned char Seg_pos; //数码管扫描变量 unsigned char Seg_buff[8] = {10,10,10,10,10,10,10,10}; unsigned char Seg_point_buff[8] = {0,0,0,0,0,0,0,0}; unsigned char Led_buff[8] = {0,0,0,0,0,0,0,0}; unsigned int wendu_dsp = 25; //温度显示变量 unsigned char Seg_mode = 0; //数码管模式变量:0--数据界面;1--参数界面 unsigned char temp_buff[2] = {30,20}; //参数显示变量 unsigned char temp_buff_control[2] = {30,20}; //参数控制变量 bit temp_or = 1; //参数数组索引变量 bit flag_canshu = 0; //参数改变标志位,如果参数改变则显示改变的参数值 float DS18B20_Read_T(); void PCF8591_DAC(unsigned char dat); void Key_pro() { if(Key_slow_down) return; Key_slow_down = 1; Key_val = Key_Read(); Key_down = Key_val & (Key_old ^ Key_val); Key_up = ~Key_val & (Key_old ^ Key_val); Key_old = Key_val; switch(Key_down) { case 4: //界面切换 if(++Seg_mode == 2) Seg_mode = 0; flag_canshu = 0; if(Seg_mode == 1){ temp_or = 1; temp_buff_control[0] = temp_buff[0]; temp_buff_control[1] = temp_buff[1]; } else { if(temp_buff_control[0] >= temp_buff_control[1]){ //参数合理性验证 temp_buff[0] = temp_buff_control[0]; temp_buff[1] = temp_buff_control[1]; Led_buff[3] = 0; } else if(temp_buff_control[0] < temp xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed xss=removed> temp_buff[0]) //实时温度>最大参数:DAC-4V,L1点亮 { PCF8591_DAC(4); Led_buff[0] = 1; Led_buff[1] = 0; Led_buff[2] = 0; } //最小参数&lt;实时温度&lt;最大参数:DAC-3V,L2点亮 else if(( wendu_dsp &lt;= temp_buff[0]) && (wendu_dsp >= temp_buff[1])) { PCF8591_DAC(3); Led_buff[0] = 0; Led_buff[1] = 1; Led_buff[2] = 0; } //实时温度&lt;最小参数:DAC-2V,L3点亮 else if(wendu_dsp &lt; temp_buff[1]) { PCF8591_DAC(2); Led_buff[0] = 0; Led_buff[1] = 0; Led_buff[2] = 1; } } void Timer0Init(void) //1毫秒@12.000MHz { AUXR &= 0x7F; //定时器时钟12T模式 TMOD &= 0xF0; //设置定时器模式 TL0 = 0x18; //设置定时初值 TH0 = 0xFC; //设置定时初值 TF0 = 0; //清除TF0标志 TR0 = 1; //定时器0开始计时 ET0 =1; EA =1; } void INT0_service() interrupt 1 { if(++Seg_slow_down == 150) Seg_slow_down = 0; if(++Key_slow_down == 10) Key_slow_down = 0; if(++Seg_pos == 8) Seg_pos = 0; SMG_disp(Seg_pos,Seg_buff[Seg_pos],Seg_point_buff[Seg_pos]); Led_disp(Seg_pos,Led_buff[Seg_pos]); } float DS18B20_Read_T() { unsigned char low, high; init_ds18b20(); Write_DS18B20(0xcc); Write_DS18B20(0x44); init_ds18b20(); Write_DS18B20(0xcc); Write_DS18B20(0xbe); low = Read_DS18B20(); high = Read_DS18B20(); return (((high &lt;&lt; 8) | low) / 16.0); } void Delay750ms() //@12.000MHz { unsigned char i, j, k; _nop_(); _nop_(); i = 35; j = 51; k = 182; do { do { while (--k); } while (--j); } while (--i); } void PCF8591_DAC(unsigned char dat) { I2CStart(); I2CSendByte(0x90); //写操作 I2CWaitAck(); I2CSendByte(0x40); //D/A转换过程,第六位为1 I2CWaitAck(); I2CSendByte(dat*51.0); //模拟量*51.0 = 数字量 I2CSendAck(1); I2CStop(); } void main() { System_init(); Timer0Init(); DS18B20_Read_T(); Delay750ms(); //延时,防止初始读出85 while(1) { Key_pro(); Led_pro(); Seg_pro(); } }
100+评论
captcha
    类型标题大小时间
    JPG虚拟视频刷机包-合集(安卓手机+苹果手机+电脑)799.1KB2周前
    ZIP.NET Framework修复工具1.11MB2周前
    DOC南京邮电大学数据库系统实验报告一(SQL语言)1.02MB2周前
    PDF清华大学出版《DeepSeek从入门到精通》 免费下载5.4MB2周前
    ZIPandroid 原生开机动画文件5.57MB2周前
    PDFCANoe10.0的安装步骤.pdf186.75KB2周前
    7ZHalcon2025年4月试用文件 2025.04-support-licenses5.25KB2周前
    ZIP抖音作品监控下载v1.22(有新版本会自动提醒)12.68MB2周前