找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 2033|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

STC12C5單片機(jī)片內(nèi)AD及1602顯示

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:300372 發(fā)表于 2018-5-24 12:46 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
main.c
  1. #include <reg52.h>
  2. #include "intrins.h"
  3. #include "ADC.h"
  4. #include "1602.h"
  5. #define uchar unsigned char
  6. #define uint unsigned int
  7. extern float temp;

  8. uchar ge,shifen;
  9. //*****************************顯示函數(shù)
  10. void show()
  11. {
  12.         DisplayListChar(1,0,"CH0:");
  13. DisplayOneChar(7,0,(int)Count(0)+0x30);     //個(gè)位
  14. DisplayOneChar(8,0,'.');
  15. DisplayOneChar(9,0,(int)(Count(0)*100)%100/10+0x30); //十分位
  16. DisplayOneChar(10,0,(int)(Count(0)*100)%100%10+0x30); //百分位
  17. DisplayOneChar(11,0,'V');
  18.         DisplayListChar(1,1,"CH1:");
  19. DisplayOneChar(7,1,(int)Count(1)+0x30);     //個(gè)位
  20. DisplayOneChar(8,1,'.');
  21. DisplayOneChar(9,1,(int)(Count(1)*100)%100/10+0x30); //十分位
  22. DisplayOneChar(10,1,(int)(Count(1)*100)%100%10+0x30); //百分位
  23. DisplayOneChar(11,1,'V');
  24. }
  25. //*******************************主函數(shù)
  26. void main()
  27. {
  28.     InitLCM();  //液晶初始化
  29.     Init_ADC();  //AD轉(zhuǎn)換初始化
  30.           
  31.           
  32.     while (1)
  33.     {
  34.     show();
  35.     }
  36. }
復(fù)制代碼
其余代碼已打包

2.zip

3.12 KB, 下載次數(shù): 15, 下載積分: 黑幣 -5

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

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

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

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