查看: 3623|回复: 5

呆呆作品——LCD12864特效2

[复制链接]
  • TA的每日心情
    无聊
    2017-1-24 10:00
  • 签到天数: 10 天

    [LV.3]偶尔看看II

    发表于 2012-9-5 12:25 | 显示全部楼层 |阅读模式
    终于弄明白了为什么这个代码有问题了,现在改好了放上来,希望能有点用处。不多说,还是学校的电脑,时间紧,就直接上代码了。有什么问题的还是跟帖说吧。

    kittenblock中小学创客名师推荐的图形化编程软件

    #include <Lcd12864.h>
    
    #include <SPI.h>
    
    
    
    
    
    lcd12864 lcd;
    unsigned char const bmpin[1024]={
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xE0,0x70,0x70,0x30,0x30,0x30,0x70,0x70,0xE0,
      0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x3C,0xFF,0xFF,0xFF,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,
      0xFF,0xFF,0xFF,0x3E,0x00,0xFE,0xFE,0xFE,0x3C,0x0E,0x06,0x06,0x0E,0xFE,0xFE,0xFC,
      0xF0,0xE0,0xF8,0xFC,0xFE,0x6E,0x66,0x66,0x66,0x7E,0x7C,0x7C,0x70,0x00,0xFE,0xFE,
      0xFE,0xFE,0x0E,0x06,0x06,0x1E,0xFE,0xFC,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x07,0x0E,0x0E,0x0C,0x0C,0x0C,0x0E,0x0E,0x07,
      0x07,0x03,0x01,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x0E,0x0C,0x0C,0x0E,0x0F,0x07,0x03,
      0x00,0x00,0x03,0x07,0x0F,0x0E,0x0C,0x0C,0x0C,0x0E,0x0E,0x06,0x00,0x00,0x0F,0x0F,
      0x0F,0x0F,0x00,0x00,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xE0,0xE0,0xE0,0x00,0x00,0x00,0x00,0xE0,0xE0,
      0xE0,0xE0,0x00,0x00,0xE0,0xE0,0xE0,0xE0,0xE0,0x60,0x60,0xE0,0xE0,0xC0,0xC0,0xE0,
      0x60,0x60,0xE0,0xE0,0xC0,0x80,0x00,0x00,0xE0,0xE0,0xE0,0xC0,0xE0,0x60,0x60,0xE0,
      0xE0,0xE0,0xC0,0x00,0x00,0x80,0xC0,0xE0,0xE0,0x60,0x60,0x60,0xE0,0xC0,0xC0,0x00,
      0x00,0xE0,0xE0,0xE0,0xE0,0xE0,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,
      0xE0,0xFF,0xFF,0x7F,0x1F,0x00,0x00,0x3F,0x7F,0xFF,0xF0,0xC0,0xC0,0xE0,0xFF,0xFF,
      0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,
      0x00,0x00,0x01,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xF3,0xE0,0xC0,0xC0,0xE0,
      0xFF,0x7F,0x3F,0x0F,0x0E,0x3F,0x7F,0xFF,0xE6,0xC6,0xC6,0xC6,0xE7,0xE7,0x67,0x07,
      0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    
    
    };
    
    unsigned char  bmp[1024] ={
    };
    
    void setup(){
      lcd.LcmInit();
    
      for(int i = 0; i < 1024; i++){
        bmp=0x00;
      }
      
      for(int j = 0 ; j < 128 ; j++){
        for(int i = 0; i <= j; i++){
          bmp[127-j+i] = bmpin;
          bmp[127-j+i+128] = bmpin[i+128];
          bmp[127-j+i+256] = bmpin[i+256];
          bmp[127-j+i+384] = bmpin[i+384];
          bmp[127-j+i+512] = bmpin[i+512];
          bmp[127-j+i+640] = bmpin[i+640];
          bmp[127-j+i+768] = bmpin[i+768];
          bmp[127-j+i+896] = bmpin[i+896];      
        }
        lcd.PUTBMP(bmp);
      }
    }
    
    void loop(){
    }



    ——BY呆呆


    该用户从未签到

    发表于 2012-9-5 20:36 | 显示全部楼层
    我也买了个12864,今天没带板子,明天回家了实验下

    该用户从未签到

    发表于 2012-11-30 16:21 | 显示全部楼层
    呆呆,我也在用12864,但是为什么我用SPI驱动12864时,PSB接地(串口模式)就会发生短路现象呢?PSB接高,也就是并口模式时可以显示效果。PS:我用的IDE是0022版。
  • TA的每日心情

    2017-1-15 12:50
  • 签到天数: 2 天

    [LV.1]初来乍到

    发表于 2016-12-25 17:14 | 显示全部楼层
    大神,我想问一下,我知道字模(书上看的,没有注释,不知道意思),有没有什么软件可以把字模译成文字呢?
  • TA的每日心情
    开心
    2019-11-4 18:07
  • 签到天数: 761 天

    [LV.10]以坛为家III

    发表于 2016-12-26 13:28 | 显示全部楼层
    看不到有什么效果
    您需要登录后才可以回帖 登录 | 立即注册  

    本版积分规则

    热门推荐

    【Arduino】108种传感器模块系列实验(55)---DHT11温湿度传感器
    【Arduino】108种传感器模
    37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是
    【Arduino】168种传感器系列实验(149)--AS608光学指纹识别模块
    【Arduino】168种传感器系
    37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是
    黑乌鸦的Arduino兵器库-----DFPlayer MiNi mp3音乐模块
    黑乌鸦的Arduino兵器库---
    嗯 这是一个系列后期会罗列几乎所有的常见基础模块的demo所以 大家的回复将是我最大
    【原创】 drawbot平面关节scara机械臂写字机 画画机器人直播...
    【原创】 drawbot平面关节
    这个项目上个月就在做了,结构和代码反反复复改了多次,加上自己又太忙,一直没来得及
    【干货分享】mega2560原理图PCB图纸altium designer18
    【干货分享】mega2560原理
    分享一下mega2560的板子 AD版本 **** 本内容被作者隐藏 **** ergo
    Copyright   ©2015-2016  Arduino中文社区  Powered by©Discuz!   
    快速回复 返回顶部 返回列表