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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2460|回復(fù): 0
收起左側(cè)

STM32F103+LCD1602+DSB18B20源程序 求幫助

[復(fù)制鏈接]
ID:772634 發(fā)表于 2020-10-9 17:07 | 顯示全部樓層 |閱讀模式
可以作為學(xué)習(xí)使用
51hei.png

單片機(jī)源程序如下:
  1. /*----------------------------------------------------------------------------
  2. * Name:    Blinky.c
  3. * Purpose: tested by hardware; but can not run on proteus platform
  4. * Version: V1.00
  5. *----------------------------------------------------------------------------*/



  6. #include "stm32f10x.h"
  7. #include "system.h"
  8. #include "LCD1602.h"
  9. #include "DS18B20.h"
  10. #include "stdio.h"

  11. unsigned char i;
  12. unsigned char a[16];
  13. struct temp tt;

  14. int main (void)
  15. {
  16.          RCC->APB2ENR|=(1<<2); //enable port A clock
  17.   GPIOA->CRL=0x33333333; //50Mhz, push-pull
  18.         GPIOA->CRH=0x00033003; //PA8,PA11,PA12 of LCD1602
  19.         
  20.   RCC->APB2ENR|=(1<<3);//DS18B20         
  21.                         
  22.     LCDInit();
  23.     LCDHideCursor();

  24.   while(1)
  25.   {
  26.       //delay_ms(1000);
  27.                  tt=Read_Temperature();
  28.              //Delay(0x0FFFEF);
  29.                  sprintf(&a[0],"%6.2f",(float)((tt.H<<8)+tt.L)/16);
  30.                 //        sprintf(&a[0],"%5d",i);
  31.                   //GPIO_SetBits(GPIOA,1<<i);
  32.                         SetCurPos(1,1);
  33.             LCDPrint(&a[0]);
  34.                         i++;
  35.    
  36.    }

  37. }
復(fù)制代碼

所有資料51hei提供下載:
4_LCD1602&amp;&amp;DS18B20.7z (283.56 KB, 下載次數(shù): 25)

回復(fù)

使用道具 舉報(bào)

無效樓層,該帖已經(jīng)被刪除
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表