打印
[Cortex-M0技术交流]

[第六批] 菜鸟学习第三贴------驱动液晶12232显示

[复制链接]
2564|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
ljp98|  楼主 | 2012-3-17 19:33 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 ljp98 于 2012-3-17 19:45 编辑

程序功能:
      上电后,液晶上显示: "     菜农学习园地      "
                                   " 欢迎你 -> NUC120 "
下面贴出主程序相关部份,完整工程在附件中,废话少说,直接上图。


//*****************************************************************************************

#include <stdio.h>
#include "NUC1xx.h"
#include "DrvGPIO.h"
#include "DrvSYS.h"
#include "DrvTimer.h"
#include "LCD12232.H"

//***************************************************************************************
//                                                                        表格
//***************************************************************************************

uint8_t tabhz00[]={ // "菜"
0x02,0x02,0x32,0x52,0x92,0x1F,0x32,0x52,0x12,0x1F,0x92,0x52,0x32,0x02,0x02,0x00,
0x00,0x42,0x42,0x22,0x12,0x0A,0x06,0xFF,0x06,0x0A,0x12,0x32,0x62,0x22,0x02,0x00};

uint8_t tabhz01[]={ // "农"
0x00,0x20,0x18,0x08,0x88,0xE8,0x1F,0x6A,0x88,0x08,0x88,0xC8,0xA8,0x1C,0x08,0x00,
0x08,0x04,0x02,0x41,0xFF,0x40,0x20,0x10,0x01,0x02,0x0D,0x18,0x70,0x20,0x20,0x00};

uint8_t tabhz02[]={ // "助"
0x00,0x00,0xFE,0x22,0x22,0x22,0xFE,0x00,0x10,0x10,0xFF,0x10,0x10,0xF0,0x00,0x00,
0x10,0x10,0x1F,0x11,0x11,0x09,0x4F,0x28,0x10,0x0C,0x03,0x20,0x40,0x3F,0x00,0x00};

uint8_t tabhz03[]={ // "学"
0x40,0x30,0x10,0x12,0x5C,0x54,0x50,0x51,0x5E,0xD4,0x50,0x18,0x57,0x32,0x10,0x00,
0x00,0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x00};

uint8_t tabhz04[]={ // "园"
0x00,0xFE,0x02,0x42,0x4A,0xCA,0x4A,0x4A,0xCA,0x4A,0x6A,0x42,0x02,0xFE,0x00,0x00,
0x00,0xFF,0x50,0x48,0x44,0x43,0x40,0x40,0x47,0x48,0x48,0x4E,0x40,0xFF,0x00,0x00};

uint8_t tabhz05[]={ // "地"
0x10,0x10,0x10,0xFE,0x10,0x50,0x40,0xFE,0x20,0x20,0xFF,0x10,0x10,0xF8,0x10,0x00,
0x20,0x20,0x10,0x1F,0x08,0x08,0x00,0x3F,0x40,0x40,0x4F,0x42,0x44,0x43,0x70,0x00};

uint8_t tabhz06[]={ // "欢"
0x14,0x24,0x44,0x84,0x64,0x1C,0x20,0x18,0x0F,0xE8,0x08,0x08,0x28,0x18,0x08,0x00,
0x20,0x10,0x4C,0x43,0x43,0x2C,0x20,0x10,0x0C,0x03,0x06,0x18,0x30,0x60,0x20,0x00};

uint8_t tabhz07[]={ // "迎"
0x40,0x41,0xCE,0x04,0x00,0xFC,0x04,0x02,0x02,0xFC,0x04,0x04,0x04,0xFC,0x00,0x00,
0x40,0x20,0x1F,0x20,0x40,0x47,0x42,0x41,0x40,0x5F,0x40,0x42,0x44,0x43,0x40,0x00};

uint8_t tabhz08[]={ // "你"
0x80,0x40,0xF0,0x2C,0x43,0x20,0x98,0x0F,0x0A,0xE8,0x08,0x88,0x28,0x1C,0x08,0x00,
0x00,0x00,0x7F,0x00,0x10,0x0C,0x03,0x21,0x40,0x3F,0x00,0x00,0x03,0x1C,0x08,0x00};

uint8_t tabzm00[]={ // "N"
0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00};

uint8_t tabzm01[]={ // "U"
0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00};

uint8_t tabzm02[]={ // "C"
0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00};

uint8_t tabfh00[]={ // "-"
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01};

uint8_t tabfh01[]={ // ">"
0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x01,0x21,0x11,0x09,0x05,0x02,0x01,0x00};

uint8_t tabsz00[]={ // "0"
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00};

uint8_t tabsz01[]={ // "1"
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00};

uint8_t tabsz02[]={ // "2"
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00};

//**************************************************************************************
//                                                                 主函数
//**************************************************************************************
int main(void)
{

    UNLOCKREG(x);                                           //解锁
    DrvSYS_SetOscCtrl(E_SYS_XTL12M, 1);        //设定时钟为外部12M
    DrvSYS_Delay(5000);                                  //延时以让系统稳定
    LOCKREG(x); //上锁

    init_1520();

    wr_lcd_L(0,13,2,16,1,1,tabhz00);                 //“菜”
    wr_lcd_L(0,29,2,16,1,1,tabhz01);                 //“农”
    wr_lcd_L(0,45,2,16,1,1,tabhz02);                 //“助”

    wr_lcd_R(0,0,2,16,1,1,tabhz03);                  //“学”
    wr_lcd_R(0,16,2,16,1,1,tabhz04);                //“园”
    wr_lcd_R(0,32,2,16,1,1,tabhz05);                //“地”

//-------------------------------------------------------------------------------------

    wr_lcd_L(2,0,2,16,1,1,tabhz06);                 //"欢"
    wr_lcd_L(2,16,2,16,1,1,tabhz07);               //"迎"
    wr_lcd_L(2,32,2,16,1,1,tabhz08);               //"你"
    wr_lcd_L(2,53,2,8,1,1,tabfh00);                 //"-"

    wr_lcd_R(2,0,2,8,1,1,tabfh01);                  //">"
    wr_lcd_R(2,13,2,8,1,1,tabzm00 );             //"N"
    wr_lcd_R(2,21,2,8,1,1,tabzm01);              //"U"
    wr_lcd_R(2,29,2,8,1,1,tabzm02);              //"C"
    wr_lcd_R(2,37,2,8,1,1,tabsz01);               //"1"
    wr_lcd_R(2,45,2,8,1,1,tabsz02);               //"2"
    wr_lcd_R(2,53,2,8,1,1,tabsz00);               //"0"

    while(1);
}

//***********************************************************************************

[/code]

P3160005.JPG (3.03 MB )

P3160005.JPG

LED12232.rar

896.4 KB

相关帖子

沙发
plc_avr| | 2012-3-17 20:19 | 只看该作者
“迟到”的笔记,呵呵,我要没记错,第六批好象是你最先传的,顶起来!多谢共享。

使用特权

评论回复
板凳
hotpower| | 2012-3-17 22:20 | 只看该作者
谢谢,俺以为第六批全消失了。

使用特权

评论回复
地板
hotpower| | 2012-3-17 22:20 | 只看该作者
谢谢,俺以为第六批全消失了。

使用特权

评论回复
5
plc_avr| | 2012-3-18 09:45 | 只看该作者
大叔别再当夜猫子了,注身休息。祝您早日康复出山。

使用特权

评论回复
6
ljp98|  楼主 | 2012-3-19 13:05 | 只看该作者
谢谢大叔和plc_avr的回复。呵呵,我不是最早的,再继续努力!

使用特权

评论回复
7
ljp98|  楼主 | 2012-5-26 18:01 | 只看该作者
自己再顶顶!

使用特权

评论回复
8
zzyaizll| | 2012-7-31 15:44 | 只看该作者
不错

使用特权

评论回复
9
samson0| | 2012-8-17 18:16 | 只看该作者
ding!!

使用特权

评论回复
10
408025182| | 2012-8-23 14:21 | 只看该作者
学习了

使用特权

评论回复
11
outstanding| | 2013-10-24 17:02 | 只看该作者
:lol

使用特权

评论回复
12
zhao00010001| | 2013-11-18 22:47 | 只看该作者
学习了,谢谢

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:持之以恒

14

主题

276

帖子

0

粉丝