查看: 3597|回复: 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-9-6 09:30
  • 签到天数: 742 天

    [LV.9]以坛为家II

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

    本版积分规则

    热门推荐

    同时读取两个传感器的数据,并上传至云端存储
    同时读取两个传感器的数据
    一个示例,仅供参考,可以自己更换传感器,或者连接更多传感器。 开发板: Wifiduin
    求助帖 新手
    求助帖 新手
    如图,第一个LED灯驱动失败,求原因… 板子是UNO R3,LED灯接在13与GND上面。
    【Arduino】108种传感器系列实验(93)---CSR8350蓝牙音乐模块
    【Arduino】108种传感器系
    37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是
    光线跟踪钛合金猫眼
    光线跟踪钛合金猫眼
    +视频 https://www.bilibili.com/video/av67732712/ +原理 ---光线跟踪 建立极
    "高精度"米家电子温湿度计Pro拆解
    "高精度"米家电子温湿度计
    为了了解哪种温湿度传感器更好,我搞了一个米家电子温湿度计Pro(阿蒙同志赠送) 价格
    Copyright   ©2015-2016  Arduino中文社区  Powered by©Discuz!   ( 蜀ICP备14017632号-3 )
    快速回复 返回顶部 返回列表