找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2229|回复: 2
打印 上一主题 下一主题
收起左侧

TX-1C 51单片机开发板外接12864无字库液晶

[复制链接]
跳转到指定楼层
楼主
ID:578758 发表于 2019-11-21 16:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5黑币
求助,自己买了一块12864无字库液晶插在开发板上调节12864可调电阻对比度丝毫没有变化,网上搜集的资料都说要外接一个可调电阻,但不知道怎么接。程序如下,请论坛里的大佬看看有没有错误,万分感谢!!!

单片机源程序如下:
  1. #include<reg52.h>
  2. #define uint unsigned int
  3. #define uchar unsigned char
  4. #define lcdrow 0xC0
  5. #define lcdpage 0xb8
  6. #define lcdcolumn 0x40
  7. #define c_page_max 0x08
  8. #define c_column_max 0x40
  9. #define bus P0
  10. sbit RST = P2^5;
  11. sbit EN = P3^4;
  12. sbit RW = P3^6;
  13. sbit RS = P3^5;
  14. sbit CS1 = P3^7;
  15. sbit dula = P2^6;
  16. sbit wela = P2^7;
  17. void delayms(uint z)
  18. {
  19.         uint x,y;
  20.         for(x = z;x > 0;x --)
  21.         for(y = 110;y > 0;y --);
  22. }
  23. void delayus(uint z)
  24. {
  25.         uint x,y;
  26.         for(x = z;x > 0;x --)
  27.         for(y = 110; y > 0;y --);
  28. }
  29. void ScreenChoose(uchar CS)
  30. {
  31.         if(CS == 0)CS1 = 1;
  32.         else CS1 = 0;
  33. }
  34. void write_cmd(uchar cmd)
  35. {
  36.         RS = 0;
  37.         RW = 0;
  38.         P0 = cmd;
  39.         delayus(10);
  40.         EN = 1;
  41.         EN = 0;
  42. }
  43. void write_data(uchar data)
  44. {
  45.         RS = 1;
  46.         RW = 0;
  47.         P0 = dat;
  48.         delayus(10);
  49.         EN = 1;#include<reg52.h>
  50. #include<intrins.h>
  51. #include<stdlib.h>
  52. #define uint unsigned int
  53. #define uchar unsigned char
  54. #define LCD_data=P0
  55. void delayms(uint z)
  56. {
  57.         uint x,y;
  58.         for(x = z;x > 0;x --)
  59.         for(y = 110;y > 0;y --);
  60. }
  61. sbit RW = P3^6;
  62. sbit RS = P3^5;
  63. sbit EN = P3^4;
  64. sbit dula = P2^6;
  65. sbit wela = P2^7;
  66. sbit CS1 = P3^7;
  67. void write_cmd(uchar cmd)
  68. {
  69.         RW = 0;
  70.         RS = 0;
  71.         EN = 0;
  72.         P0 = cmd;
  73.         delayms(5);
  74.         EN = 1;
  75.         delayms(5);
  76.         EN = 0;
  77. }
  78. void write_dat(uchar date)
  79. {
  80.         RS = 1;
  81.         RW = 0;
  82.         EN = 0;
  83.         P0 = date;
  84.         delayms(5);
  85.         EN = 1;
  86.         delayms(5);
  87.         EN = 0;
  88. }
  89. uchar code picture[] ={
  90.      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  91.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  92.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  93.       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  94.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  95.       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  96.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
  97.       0x10,0x04,0x00,0x40,0xF1,0x02,0x10,0x01,
  98.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
  99.       0xFE,0x0A,0x07,0xFE,0x11,0x07,0xBE,0x01,
  100.       0x83,0xED,0x80,0xF8,0x87,0xBE,0x23,0xC4,
  101.       0x82,0x11,0x04,0x02,0x52,0x89,0x48,0x01,
  102.       0x82,0xA5,0x00,0x81,0x88,0xAA,0x21,0x29,
  103.       0x7C,0x20,0x89,0x24,0x54,0x42,0x00,0x01,
  104.       0x80,0x85,0x00,0x80,0x88,0x08,0x31,0x2E,
  105.       0x00,0xDF,0x60,0xA0,0x5B,0xA2,0x7C,0x01,
  106.       0x80,0x82,0x3E,0xF0,0x86,0x08,0x51,0xC2,
  107.       0xFE,0x00,0x02,0x20,0xF0,0x0F,0xC4,0x01,
  108.       0x80,0x82,0x00,0x08,0x81,0x08,0x51,0x45,
  109.       0x10,0x00,0x01,0x20,0x15,0x42,0x7C,0x01,
  110.       0x80,0x85,0x00,0x08,0x80,0x88,0x79,0x2E,
  111.       0x58,0x3F,0x8F,0xFE,0x35,0x47,0x44,0x01,
  112.       0x80,0x85,0x00,0x88,0x88,0x88,0x49,0x21,
  113.       0x54,0x20,0x80,0x50,0xD5,0x4A,0x7C,0x01,
  114.       0x81,0xCD,0x80,0x71,0xCF,0x1C,0xCF,0xBE,
  115.       0x92,0x20,0x80,0x88,0x10,0x82,0x44,0x01,
  116.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  117.       0x30,0x3F,0x87,0x04,0x6F,0xE2,0x7C,0x01,
  118.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  119.       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  120.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  121.       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  122.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  123.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  124.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  125.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  126.       0x80,0x03,0xFF,0xFB,0x7C,0x00,0x70,0x38,
  127.       0x77,0xFA,0xBF,0xFF,0xFF,0xFF,0xE0,0x01,
  128.       0x80,0x03,0xFF,0xFA,0xFF,0xD7,0xF7,0xBF,
  129.       0x40,0x86,0xDF,0xFF,0xFF,0xFF,0xE0,0x01,
  130.       0x80,0x03,0xFF,0xF6,0x06,0x00,0xF0,0x3B,
  131.       0x5E,0xF6,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  132.       0x80,0x03,0xFF,0xE5,0xF6,0xD6,0xF7,0xBB,
  133.       0x40,0x80,0x0F,0xFF,0xFF,0xFF,0xE0,0x01,
  134.       0x80,0x03,0xFF,0xD3,0xBE,0x00,0xF0,0x3B,
  135.       0x5F,0xF6,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  136.       0x80,0x03,0xFF,0xF6,0xAF,0xDF,0xFF,0xF8,
  137.       0x40,0xF4,0xDF,0xFF,0xFF,0xFF,0xE0,0x01,
  138.       0x80,0x03,0xFF,0xF6,0xAC,0x00,0x00,0x0F,
  139.       0x4A,0xE2,0xBF,0xFF,0xFF,0xFF,0xE0,0x01,
  140.       0x80,0x03,0xFF,0xF5,0xB7,0xBB,0xED,0xFE,
  141.       0x40,0x97,0x7F,0xFF,0xFF,0xFF,0xE0,0x01,
  142.       0x80,0x03,0xFF,0xF3,0xB7,0x17,0xE4,0x19,
  143.       0x2A,0xF6,0x6F,0xFF,0xFF,0xFF,0xE0,0x01,
  144.       0x80,0x03,0xFF,0xF7,0xBF,0xE3,0xD9,0xFF,
  145.       0x6A,0xF1,0xAD,0xEF,0xBE,0xF7,0xE0,0x01,
  146.       0x80,0x03,0xFF,0xF6,0x3C,0x1C,0xBC,0x0C,
  147.       0x7C,0xC7,0xCF,0xFF,0xFF,0xFF,0xE0,0x01,
  148.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  149.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  150.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  151.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  152.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  153.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  154.       0x80,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  155.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,
  156.       0x80,0x03,0xAB,0xFF,0xFF,0xFF,0xFF,0xFF,
  157.       0xFF,0xFF,0x87,0xFF,0xF7,0xFF,0xE0,0x01,
  158.       0x80,0x03,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
  159.       0xFF,0xFF,0x80,0xFF,0x73,0xFF,0xE0,0x01,
  160.       0x80,0x03,0x00,0xBF,0xFF,0xFF,0xCF,0xFF,
  161.       0xFF,0xFF,0xFE,0xF6,0x33,0xFF,0xE0,0x01,
  162.       0x80,0x03,0xC7,0xFF,0xFF,0xFF,0x1F,0xBF,
  163.       0xFF,0xF3,0xFE,0xE4,0x13,0xFF,0xE0,0x01,
  164.       0x80,0x03,0xA3,0xFF,0xFF,0xFC,0x1C,0x7D,
  165.       0xFF,0xFC,0xFF,0xC0,0x83,0xFF,0xE0,0x01,
  166.       0x80,0x03,0x6D,0xFF,0xFF,0xF0,0x30,0x71,
  167.       0xFD,0xFF,0x3F,0xB9,0xC7,0xFF,0xE0,0x01,
  168.       0x80,0x03,0xEF,0xDF,0x8F,0xE0,0x00,0x43,
  169.       0x7E,0x3F,0xCF,0xF9,0xF7,0xFF,0xE0,0x01,
  170.       0x80,0x03,0xFF,0xEF,0x07,0xC0,0x00,0x02,
  171.       0x5F,0x07,0xE3,0xFB,0xFF,0xBF,0xE0,0x01,
  172.       0x80,0x03,0xEF,0xAE,0x63,0x80,0x00,0xE4,
  173.       0x43,0xC0,0xF0,0xFF,0xFE,0xFF,0xE0,0x01,
  174.       0x80,0x03,0xFF,0xC6,0x93,0x80,0x00,0x10,
  175.       0x40,0x70,0x18,0x7E,0x3E,0x5F,0xE0,0x01,
  176.       0x80,0x03,0xFF,0x46,0x2B,0x00,0x00,0x00,
  177.       0xC0,0x00,0x04,0x3C,0x1E,0x3F,0xE0,0x01,
  178.       0x80,0x03,0xFF,0x82,0x28,0x00,0x00,0x00,
  179.       0xC0,0xE0,0x00,0x18,0xCC,0x6F,0xE0,0x01,
  180.       0x80,0x03,0xFE,0x81,0x10,0x00,0x00,0x01,
  181.       0x41,0x00,0x00,0x19,0x2C,0x5F,0xE0,0x01,
  182.       0x80,0x03,0xFF,0x01,0x80,0x00,0x3F,0x01,
  183.       0x20,0x00,0x00,0x0A,0x88,0x17,0xE0,0x01,
  184.       0x80,0x03,0xFD,0x01,0xC0,0x00,0xFF,0x82,
  185.       0x20,0x00,0x00,0x02,0x88,0x0F,0xE0,0x01,
  186.       0x80,0x03,0xFE,0x03,0xE0,0x00,0x03,0xC4,
  187.       0x10,0x1F,0x80,0x01,0x10,0x07,0xE0,0x01,
  188.       0x80,0x03,0xFA,0x07,0xA0,0x00,0x07,0x08,
  189.       0x11,0x3F,0xE0,0x00,0x3C,0x0F,0xE0,0x01,
  190.       0x80,0x03,0xFC,0x00,0x20,0x00,0x06,0x10,
  191.       0x08,0xF8,0x00,0x00,0x7E,0x0B,0xE0,0x01,
  192.       0x80,0x03,0xF4,0x00,0x40,0x00,0x02,0x20,
  193.       0x04,0x18,0x00,0x00,0x41,0x07,0xE0,0x01,
  194.       0x80,0x03,0xF8,0x07,0x80,0x04,0x4C,0x20,
  195.       0x02,0x1C,0x00,0x00,0x40,0x06,0xE0,0x01,
  196.       0x80,0x03,0xFC,0x18,0x80,0x02,0x20,0x40,
  197.       0x01,0x0C,0x00,0x00,0x40,0x04,0x60,0x01,
  198.       0x80,0x03,0xF4,0x28,0x40,0x05,0x10,0x40,
  199.       0x00,0x88,0x00,0x00,0x60,0x06,0xE0,0x01,
  200.       0x80,0x03,0xE0,0x44,0x40,0x02,0x00,0x40,
  201.       0x00,0x86,0x44,0x00,0x50,0x07,0xE0,0x01,
  202.       0x80,0x03,0xF0,0x42,0x21,0xC0,0x00,0x40,
  203.       0x00,0x40,0x88,0x0F,0x80,0x02,0xE0,0x01,
  204.       0x80,0x03,0xF8,0x82,0x11,0x30,0x00,0x80,
  205.       0x00,0x41,0x14,0x14,0xC4,0x03,0xE0,0x01,
  206.       0x80,0x03,0xD0,0x81,0x0E,0x2E,0x03,0x00,
  207.       0x00,0x40,0x08,0x22,0x22,0x02,0xE0,0x01,
  208.       0x80,0x03,0xF0,0x81,0x00,0x23,0xFC,0x00,
  209.       0x00,0x40,0x00,0x61,0x01,0x01,0xE0,0x01,
  210.       0x80,0x03,0xD8,0x81,0x00,0x22,0x00,0x00,
  211.       0x00,0x20,0x01,0xA1,0x00,0x03,0x60,0x01,
  212.       0x80,0x03,0xF0,0x81,0x00,0x22,0x00,0x00,
  213.       0x00,0x18,0x0E,0x40,0x80,0x81,0xA0,0x01,
  214.       0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  215.       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
  216.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  217.       0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
  218. };

  219. uchar code Photo[] ={
  220. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  221. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  222. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  223. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  224. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  225. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  226. 0x00,0x7F,0x00,0x00,0x00,0x03,0xFE,0x00,0x00,0x00,0x00,0x02,0x00,0x76,0x00,0x00,
  227. 0x00,0xC3,0xFF,0x00,0x00,0x3F,0xE7,0xE0,0x00,0x00,0x00,0x03,0x00,0xFF,0x80,0x00,
  228. 0x00,0x81,0xFF,0xFE,0x00,0x7C,0x03,0xF0,0x00,0x00,0x00,0x01,0xF7,0xCB,0xF8,0x00,
  229. 0x01,0x83,0xF8,0x7B,0x00,0x40,0x00,0x30,0x00,0x00,0x00,0x00,0x3F,0xC0,0xF8,0x00,
  230. 0x03,0x1E,0x3C,0x01,0x80,0x60,0x00,0x30,0x00,0x00,0x00,0x00,0x01,0x40,0x18,0x00,
  231. 0x03,0x30,0x0C,0x01,0xE0,0x6C,0x00,0x70,0x00,0x00,0x00,0x00,0x01,0x7C,0xCC,0x00,
  232. 0x03,0x24,0x6F,0x31,0x20,0x7C,0x40,0x60,0x00,0x00,0x00,0x00,0x01,0x97,0xFC,0x00,
  233. 0x01,0xBF,0xFB,0xF3,0xE0,0x3F,0xE7,0xC0,0x00,0x00,0x00,0x00,0x01,0xFB,0x1C,0x00,
  234. 0x00,0x9B,0xC2,0x1F,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x0C,0xFE,0x00,
  235. 0x00,0xCC,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xB8,0x00,
  236. 0x00,0x7E,0x7E,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
  237. 0x00,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,
  238. 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x03,0xFF,0xE0,0x00,0x00,0x00,0x00,
  239. 0x00,0x00,0x00,0x1F,0x00,0x00,0x78,0x01,0xC0,0x00,0x00,0x70,0x00,0x00,0x00,0x00,
  240. 0x00,0x00,0x00,0x20,0x80,0x00,0xF8,0x01,0x80,0x00,0x00,0x30,0x00,0x00,0x00,0x00,
  241. 0x00,0x00,0x00,0x2E,0x80,0x00,0xD8,0x03,0x60,0x00,0x01,0xF8,0x00,0x00,0x00,0x00,
  242. 0x00,0x00,0x00,0x2A,0x80,0x00,0x98,0x02,0x60,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,
  243. 0x00,0x00,0x00,0x2E,0x80,0x01,0x98,0x03,0xE0,0xC0,0x00,0x60,0x00,0x00,0x00,0x00,
  244. 0x00,0x00,0x00,0x20,0x83,0xFF,0x8C,0x07,0xE1,0xC8,0x00,0x30,0x00,0x00,0x00,0x00,
  245. 0x00,0x00,0x00,0x1F,0x7F,0x07,0x8C,0x0F,0xFF,0x8C,0x00,0x18,0x00,0x00,0x00,0x00,
  246. 0x00,0x00,0x00,0x00,0xB8,0x0F,0xCC,0x1F,0x83,0x8F,0x00,0x18,0x00,0x00,0x00,0x00,
  247. 0x00,0x00,0x00,0x39,0xC0,0x38,0xFE,0x1E,0x00,0x8F,0xC0,0x0C,0x00,0x00,0x00,0x00,
  248. 0x00,0x00,0x00,0x3B,0x80,0x70,0x1E,0x00,0x00,0xCC,0xF0,0x0C,0x00,0x00,0x00,0x00,
  249. 0x00,0x00,0x00,0x76,0x00,0xC0,0x00,0x00,0x00,0x6E,0x3C,0x06,0x00,0x00,0x00,0x00,
  250. 0x00,0x00,0x00,0x7E,0x01,0x80,0x00,0x00,0x00,0x3F,0x0E,0x06,0x00,0x00,0x00,0x00,
  251. 0x00,0x00,0x00,0xDC,0x03,0x00,0x00,0x00,0x00,0x1F,0x03,0x82,0x00,0x00,0x00,0x00,
  252. 0x00,0x00,0x00,0xD8,0x06,0x00,0x00,0x00,0x00,0x00,0x01,0xC2,0x00,0x00,0x00,0x00,
  253. 0x00,0x00,0x00,0xC0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xC2,0x00,0x00,0x00,0x00,
  254. 0x00,0x00,0x00,0x80,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x00,0x00,0x00,0x00,
  255. 0x00,0x00,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,
  256. 0x00,0x00,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x00,
  257. 0x00,0x00,0x00,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x00,0x00,0x00,0x00,
  258. 0xFF,0xFF,0xFF,0x80,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFE,0x00,
  259. 0x00,0x00,0x01,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x3F,0xD8,0x00,0x00,0x00,0x00,
  260. 0x3E,0x00,0x01,0x80,0x60,0x00,0x00,0x00,0x07,0xE0,0x3D,0xF0,0x01,0xF0,0x0C,0x00,
  261. 0xFF,0x80,0x01,0x80,0x6C,0x00,0x00,0x00,0x3E,0xF0,0x2C,0x60,0x07,0xFF,0xFC,0x00,
  262. 0x81,0xF8,0x71,0x01,0xDC,0x03,0xFC,0x00,0xF3,0xFF,0x87,0xE0,0x06,0x07,0xE0,0x00,
  263. 0x00,0x3F,0xE1,0x03,0xFC,0x0F,0x1F,0x87,0xC2,0x00,0x04,0xE0,0x00,0x00,0x00,0x00,
  264. 0x00,0x00,0x03,0x00,0x0C,0x1C,0x03,0xFF,0x00,0x00,0x01,0xE0,0x7F,0x03,0xF0,0x00,
  265. 0x00,0x00,0x03,0x00,0x18,0x10,0x00,0x00,0x00,0x00,0x01,0xC1,0xF3,0xF7,0x3C,0x00,
  266. 0xFF,0xC0,0x0F,0x02,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x7E,0x0E,0x00,
  267. 0xE1,0xFF,0xFF,0x03,0xF0,0x00,0x00,0x00,0x00,0x03,0xF8,0x7C,0x00,0x00,0x02,0x00,
  268. 0x00,0x01,0xE3,0x03,0xC0,0x00,0x03,0xFF,0x00,0x0F,0x1F,0xE0,0x00,0x00,0x00,0x00,
  269. 0x00,0x00,0x03,0x01,0x00,0x00,0x0F,0x03,0xF0,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
  270. 0x03,0xFC,0x03,0x01,0x0F,0x00,0x0C,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
  271. 0x0F,0x0F,0x8D,0x01,0x3F,0xE0,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  272. 0x1C,0x01,0xFD,0x81,0x30,0x7C,0x03,0xC0,0xFE,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
  273. 0x18,0x00,0x01,0xBF,0x00,0x0F,0xFF,0x07,0xC7,0xE0,0x00,0x00,0x1C,0x00,0x00,0x00,
  274. 0x00,0x00,0x00,0xFF,0x80,0x01,0xF8,0x3E,0x00,0x78,0x0F,0xF0,0x78,0x00,0x00,0x00,
  275. 0x00,0x0F,0x00,0x7F,0x83,0x80,0x3F,0xF1,0xF8,0x1E,0x1C,0x7F,0xE0,0x07,0xE0,0x00,
  276. 0x00,0x1F,0xE0,0x3F,0xDF,0xFE,0x00,0x07,0x9F,0x83,0xF0,0x00,0x00,0x1C,0x7C,0x00,
  277. 0x00,0x78,0x70,0x1F,0xD0,0x07,0xC0,0x3C,0x01,0xF8,0x03,0xC0,0x00,0x18,0x00,0x00,
  278. 0xFF,0xE0,0x1F,0x73,0xE0,0x00,0xFF,0xE0,0x00,0x1F,0xFF,0x00,0x00,0x00,0x00,0x00,
  279. 0x00,0x00,0x07,0xE1,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  280. 0x00,0x0F,0x80,0x00,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  281. 0x00,0x7F,0xE0,0x00,0x07,0x9E,0x00,0x7F,0xC0,0x60,0x0F,0xC0,0x0F,0x00,0x00,0x00,
  282. 0x00,0xE0,0x7C,0x00,0x03,0xF7,0xC7,0xE0,0xFF,0xE0,0x3F,0xFF,0xFC,0x00,0x00,0x00,
  283. 0x01,0xC0,0x0F,0x00,0x03,0xBD,0xFE,0xFC,0x00,0x00,0xF0,0x1F,0xF0,0x00,0xC6,0x00,
  284. };


  285. void lcd_init()
  286. {
  287.         CS1 = 1;        
  288.         write_cmd(0x3f);
  289.         write_cmd(0xC0);
  290.         write_cmd(0x01);     
  291.   write_cmd(0x06);
  292. }
  293. void photodisplay(uchar *bmp)        
  294. {
  295.   uchar p,z;
  296.   write_dat(0x34);        
  297.   for(p=0;p<32;p++)
  298.   {
  299.     write_dat(0x80+p);   
  300.     write_dat(0x80);      
  301.     for(p=0;p<16;p++)
  302.                         write_dat(*bmp++);   
  303.     delayms(1);
  304.   }

  305.   for(z=0;z<32;z++)
  306.   {
  307.     write_dat(0x80+z);
  308.     write_dat(0x88);
  309.     for(p=0;p<16;p++)
  310.                         write_dat(*bmp++);
  311.                 delayms(1);
  312.   }
  313.   write_cmd(0x36);      
  314. }

  315. void main()
  316. {
  317.         dula = 0;
  318.         wela = 0;
  319.         lcd_init();
  320.         while(1)
  321.         {
  322.                 photodisplay(Photo);
  323.                 delayms(1000);
  324.                 write_cmd(0x3f);
  325.                 write_cmd(0x01);
  326.                
  327.                 photodisplay(picture);
  328.                 delayms(1000);
  329.                 write_cmd(0x3f);
  330.                 write_cmd(0x01);
  331.         }
  332. }EN = 0;
  333. }
复制代码

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:123289 发表于 2019-11-21 21:47 | 只看该作者
先看LCD的说明!!
回复

使用道具 举报

板凳
ID:584814 发表于 2019-11-22 12:50 | 只看该作者
看硬件手册。
1、需外接可调电阻,如何接什么参数的电阻,看手册;
2、电调的,通过指令操作,如何实现要看手册;
3、不提供调节功能的,也需要看手册确认。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表