标题: 51单片机显示土壤湿度,oled,pcf8591,模块化程序编译错误 [打印本页]

作者: 1805220100    时间: 2021-5-24 17:07
标题: 51单片机显示土壤湿度,oled,pcf8591,模块化程序编译错误
制作出来的实物图如下:


单片机源程序如下:
  1. #include "codetab.h"
  2. #include "LQ12864.h"
  3. #include "PCF8591.h"



  4. void main(void)
  5. {
  6.         uint max;

  7.         OLED_Init(); //OLED初始化


  8.         while(1)
  9.         {
  10.                 max=du24c02(0);
  11.                 max=max/2.55;

  12.                 ready8t_16(0,0,max/100);      
  13.                 ready8t_16(16,0,max%100/10);
  14.                 ready8t_16(32,0,max%100%10);
  15.                 OLED_P8x16Str(32+16,0,"%");
  16.                
  17.                 OLED_P16x16Ch(0,6,32);
  18.                 OLED_P16x16Ch(16,6,33);

  19.         }
  20. }
复制代码


错误代码51hei下载地址:
oled- 51湿度系统.rar (92.63 KB, 下载次数: 48)


作者: 1805220100    时间: 2021-5-25 19:50
上面的程序用keil5编译是正确的,我的目的是分享给大家pcf8591模块和oled模块的程序,可以直接移植,不知道为啥审核的人把我发的贴性质改了
作者: 51hei团团    时间: 2021-5-28 04:29
用Keil4编译确实有错误,大家一起找下原因看看
作者: 1805220100    时间: 2021-8-8 20:10
51hei团团 发表于 2021-5-28 04:29
用Keil4编译确实有错误,大家一起找下原因看看

显示的uint 和uchar 的问题,改为unsigned int 和char 即可
作者: wjq050325    时间: 2024-3-30 17:17
大佬你具体用的哪些模块啊
作者: wjq050325    时间: 2024-3-30 17:18
有没有最新版的程序大佬




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1