欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: AVR16 AVR128的DS18B20溫度傳感器protues仿真與源碼 [打印本頁(yè)]

作者: claire2108    時(shí)間: 2018-1-14 00:04
標(biāo)題: AVR16 AVR128的DS18B20溫度傳感器protues仿真與源碼
單片機(jī)溫度計(jì)設(shè)計(jì)仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


有AVR16芯片和AVR128芯片2個(gè)版本

單片機(jī)源程序如下:
  1. /*-------------------------------
  2. 作者:小新
  3. email:xuxing1261207@126.com
  4. --------------------------------*/
  5. #include <iom16v.h>
  6. #include <macros.h>
  7. #include "lcd.h"
  8. #include "ds18b20.h"
  9. unsigned int  temp1=20,temp2=35;

  10. void main(void)
  11. {
  12.    unsigned char i=0;
  13.    
  14.    DDRD=0xff;
  15.    PORTD=0x00;
  16.    DDRC=0x00;
  17.    PORTC=0xFF;
  18.    CLI();
  19.    LCD_init();
  20.    SEI();
  21.    LCD_DisplayString(1,1,"Down:     Up:  ");
  22.    LCD_DisplayString(2,1,"T=");
  23.    while(1)
  24.    {
  25.      i=PINC;
  26.      if((i&0x01)==0)
  27.          {
  28.         //while(!(i&0x01));
  29.                   temp1++;
  30.          }
  31.          if((i&0x04)==0)
  32.          {
  33.             //while(!(i&0x04));
  34.                 temp1--;
  35.          }
  36.          
  37.          if((i&0x10)==0)
  38.          {
  39.         //while(!(i&0x01));
  40.                   temp2++;
  41.          }
  42.          if((i&0x40)==0)
  43.          {
  44.             //while(!(i&0x04));
  45.                 temp2--;
  46.          }
  47. ……………………

  48. …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼

所有資料51hei提供下載:
DS18B20溫度傳感器protues仿真 avr16128 ds18b20單片機(jī)仿真程序.zip (183.14 KB, 下載次數(shù): 145)



作者: zhiwenjing2020    時(shí)間: 2020-5-4 12:22
老鐵,謝謝分享有用的資料!
作者: bg4xo    時(shí)間: 2020-5-6 16:27
非常感謝,還沒(méi)入門(mén)




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1