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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索

LM041L顯示不出來,求大神幫忙!!

查看數: 4834 | 評論數: 7 | 收藏 0
關燈 | 提示:支持鍵盤翻頁<-左 右->
    組圖打開中,請稍候......
發布時間: 2018-5-3 19:24

正文摘要:

本帖最后由 01100110 于 2018-5-3 19:26 編輯 代碼: #include<reg51.h> #define uchar unsigned char #define uint unsigned int sbit E=P2^0; sbit RW=P2^1; sbit RS=P2^2; uchar tab1[]="www.5 ...

回復

ID:619259 發表于 2024-5-15 16:14
袁泳華 發表于 2024-5-15 10:42
請問怎么解決的?

原工程P0口沒有上拉電阻,低級錯誤。有人指出了,所以解決了。
ID:217048 發表于 2024-5-15 10:42
01100110 發表于 2018-5-4 18:35
謝謝 已經解決了

請問怎么解決的?
ID:217048 發表于 2024-5-15 09:34
01100110 發表于 2018-5-4 18:35
謝謝 已經解決了

怎么解決的?
ID:155507 發表于 2021-4-24 13:57
hmhahaha 發表于 2021-4-24 12:51
兄弟LM04l顯示三行數據可以嗎,為啥我開頭再定義一個數組顯示數組越界?


我給你來個試試



  1. #include <reg51.h>
  2. #define uchar unsigned char
  3. #define uint  unsigned int
  4. sbit E=P2^0;
  5. sbit RW=P2^1;
  6. sbit RS=P2^2;

  7. uchar code tab1[]="www.raoushi.com";
  8. uchar code tab2[]="LCD1602 test ok!";
  9. uchar code tab3[]="Line number 3   ";
  10. uchar code tab4[]="Line number 4   ";

  11. void delay(uint del)
  12. {
  13.         uint i,j;
  14.         for(i=0;i<del;i++)
  15.             for(j=0;j<=168;j++);
  16. }
  17. void writecmd(uchar com)
  18. {
  19.         E=0;
  20.         RS=0;   //寫入命令
  21.         RW=0;
  22.         P0=com;
  23.         delay(2);
  24.         E=1;
  25.         delay(2);
  26.         E=0;
  27. }
  28. void writedata(uchar dat)
  29. {
  30.         E=0;
  31.         RS=1;     //寫入數據
  32.         RW=0;
  33.         P0=dat;
  34.         delay(2);
  35.         E=1;
  36.         delay(2);
  37.         E=0;
  38. }
  39. void init(void)
  40. {
  41.         writecmd(0x38);    //設置16*4顯示,5*7點陣,8位數據接口
  42.         writecmd(0x0c);    //顯示開,關光標
  43.         writecmd(0x06);    //移動光標
  44.         writecmd(0x01);    //清除LCD的顯示內容
  45. }
  46. void main(){
  47.         uchar j;
  48.         init();
  49.         writecmd(0x80);
  50.         for(j=0;j<13;j++)
  51.         {
  52.                 writedata(tab1[j]);
  53.                 delay(2);
  54.         }
  55.         writecmd(0x80+0x40);
  56.         for(j=0;j<16;j++)
  57.         {
  58.                 writedata(tab2[j]);
  59.                 delay(2);
  60.         }
  61.         writecmd(0x90);
  62.         for(j=0;j<13;j++)
  63.         {
  64.                 writedata(tab3[j]);
  65.                 delay(2);
  66.         }
  67.         writecmd(0x90+0x40);
  68.         for(j=0;j<16;j++)
  69.         {
  70.                 writedata(tab4[j]);
  71.                 delay(2);
  72.         }
  73.         while(1);
  74. }

復制代碼



ID:909161 發表于 2021-4-24 12:51
兄弟LM04l顯示三行數據可以嗎,為啥我開頭再定義一個數組顯示數組越界?
ID:321506 發表于 2018-5-4 18:35
wulin 發表于 2018-5-4 08:55
程序沒有問題,電路圖錯誤。

謝謝 已經解決了
ID:213173 發表于 2018-5-4 08:55
程序沒有問題,電路圖錯誤。


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

Powered by 單片機教程網

快速回復 返回頂部 返回列表