查看: 3797|回复: 5

呆呆作品——LCD12864特效2

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

    [LV.3]偶尔看看II

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

    [mw_shl_code=cpp,true]#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(){
    }[/mw_shl_code]


    ——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的每日心情
    开心
    2020-7-1 09:10
  • 签到天数: 817 天

    [LV.10]以坛为家III

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

    本版积分规则

    热门推荐

    5分钟带你快速了解新一代开发板:M5STACK
    5分钟带你快速了解新一代
    一、什么是M5Stack M5Stack是一种模块化、可堆叠扩展的开发板,每个模块
    【原创】全球最小口袋3D打印机mini one直播教程贴
    【原创】全球最小口袋3D打
    最近闲得蛋疼,没事搞个掌上3D打印机,先放效果图吧。 搞了半天,终于能正常打印,
    【小项目】基于XIAO的逃跑蜘蛛
    【小项目】基于XIAO的逃跑
    项目介绍:蜘蛛会在夜晚保持安静。但是一有光线,蜘蛛就会开始震动,逃离光线。硬件:
    心电传感器实验 ESP32 + AD8232
    心电传感器实验 ESP32 + A
    早前买了心电传感器,一直没机会用起来,疫情期间无聊翻将出来发现买错了,但是心电导
    Stduino IDE stm32 最小系统 小蓝板 驱动继电器(五)
    Stduino IDE stm32 最小系
    弱电控制强电 单片机输出输入的电压在3.3V到5V之间,而生活中常用电器很多是12V、220V
    Copyright   ©2015-2016  Arduino中文社区  Powered by©Discuz!   
    快速回复 返回顶部 返回列表