• 售前

  • 售后

热门帖子
入门百科

【NB-IoT模块显示屏逻辑显示】

[复制链接]
韩邑王生1977 显示全部楼层 发表于 2022-1-15 09:33:10 |阅读模式 打印 上一主题 下一主题
NB-IoT模块显示屏逻辑显示



一、最终按键控制文字滚动效果:


  NB-IOT模块显示屏文字滚动

二、实验要求:


三、实现部分代码剖析:

1、对需要显示的汉字按要求进行取模并加入字库中


  • 从上到下循环滚动时,需要将汉字旋转90度
  • 把数据添加到字库中,并做好注释
  1. /*取模汉字添加到字库中,大小统一为16*16像素*/
  2. {0x42,0x4A,0xD2,0x6A,0x46,0xC0,0x00,0xF2,0x12,0x1A,0xD6,0x12,0x12,0xF2,0x02,0x00},
  3. {0x40,0x80,0x7F,0x00,0x01,0x00,0x80,0x4F,0x20,0x18,0x07,0x10,0x20,0x4F,0x80,0x00},/*"预",52*/
  4. {0x08,0x08,0x89,0xEE,0x98,0x00,0x7E,0x42,0xC2,0x42,0x42,0xC2,0x42,0x7E,0x00,0x00},
  5. {0x02,0x01,0x00,0xFF,0x80,0x43,0x20,0x18,0x07,0x00,0x00,0x3F,0x40,0x40,0x78,0x00},/*"祝",53*/
  6. {0x00,0xFE,0x00,0xFC,0x00,0xFF,0x00,0xF2,0x12,0x1A,0xD6,0x12,0x12,0xF2,0x02,0x00},
  7. {0x40,0x3F,0x00,0x3F,0x00,0xFF,0x80,0x4F,0x20,0x18,0x07,0x10,0x20,0x4F,0x80,0x00},/*"顺",54*/
  8. {0x40,0x44,0x44,0x44,0xC4,0xFE,0x42,0x43,0x42,0x00,0xF8,0x00,0x00,0xFF,0x00,0x00},
  9. {0x20,0x10,0x0C,0x03,0x00,0xFF,0x01,0x02,0x04,0x00,0x0F,0x40,0x80,0x7F,0x00,0x00},/*"利",55*/
  10. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
  11. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",56*/
  12. //把需要显示的汉字旋转90度,从上到下显示
  13. {0x00,0xFE,0x20,0x40,0xFC,0x04,0x24,0x24,0x24,0x24,0x24,0x44,0x50,0x88,0x04,0x02},
  14. {0x00,0xF9,0x08,0x50,0x21,0x11,0xFD,0x25,0x29,0x21,0x21,0x21,0x20,0x20,0xA1,0x42},/*"预",57*/
  15. {0x00,0xFC,0x04,0x04,0x04,0x04,0xFC,0x90,0x90,0x90,0x90,0x12,0x12,0x12,0x0E,0x00},
  16. {0x20,0x13,0x12,0xFA,0x0A,0x12,0x13,0x38,0x54,0x94,0x10,0x11,0x11,0x12,0x14,0x18},/*"祝",58*/
  17. {0x00,0xFE,0x20,0x40,0xFC,0x04,0x24,0x24,0x24,0x24,0x24,0x44,0x50,0x88,0x04,0x02},
  18. {0x04,0x45,0x54,0x54,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x54,0x54,0x85,0x06},/*"顺",59*/
  19. {0x04,0x84,0x04,0x24,0x24,0x24,0xA4,0x24,0x24,0x24,0xA4,0x24,0x04,0x04,0x14,0x08},
  20. {0x01,0x07,0x7C,0x04,0x04,0x04,0xFF,0x0C,0x16,0x15,0x24,0x24,0x44,0x84,0x04,0x04},/*"利",60*/
复制代码


  • 添加了横屏和竖屏的汉字,并添加一个空白的汉字擦除汉字;
2、初始化OLED外设

  1. //初始化部分外设
  2.   OLED_Init();
  3.   OLED_Clear();
复制代码
3、进行按钮事件监听

  1. KeyDownHandler();  //进行按钮事件监听
复制代码
4、对Key2进行算法搭建

[code]//点击Key2按键 if(isKey2Pressed()){  resetKey2();  //从右向左逐渐刷新显示汉字  for(int i=0;i

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

帖子地址: 

回复

使用道具 举报

分享
推广
火星云矿 | 预约S19Pro,享500抵1000!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

草根技术分享(草根吧)是全球知名中文IT技术交流平台,创建于2021年,包含原创博客、精品问答、职业培训、技术社区、资源下载等产品服务,提供原创、优质、完整内容的专业IT技术开发社区。
  • 官方手机版

  • 微信公众号

  • 商务合作