LED 模块的 ASCII 7x5 侧馈字符 [英] ASCII 7x5 side-feeding characters for led modules

查看:20
本文介绍了LED 模块的 ASCII 7x5 侧馈字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里查看字体文件的代码:http://www.openobject.org/opensourceurbanism/Bike_POV_Beta_4

I am looking at the code for the font file here: http://www.openobject.org/opensourceurbanism/Bike_POV_Beta_4

代码如下:

const byte font[][5] = {
  {0x00,0x00,0x00,0x00,0x00},   //   0x20 32
  {0x00,0x00,0x6f,0x00,0x00},   // ! 0x21 33
  {0x00,0x07,0x00,0x07,0x00},   // " 0x22 34
  {0x14,0x7f,0x14,0x7f,0x14},   // # 0x23 35
  {0x00,0x07,0x04,0x1e,0x00},   // $ 0x24 36
  {0x23,0x13,0x08,0x64,0x62},   // % 0x25 37
  {0x36,0x49,0x56,0x20,0x50},   // & 0x26 38
  {0x00,0x00,0x07,0x00,0x00},   // ' 0x27 39
  {0x00,0x1c,0x22,0x41,0x00},   // ( 0x28 40
  {0x00,0x41,0x22,0x1c,0x00},   // ) 0x29 41
  {0x14,0x08,0x3e,0x08,0x14},   // * 0x2a 42
  {0x08,0x08,0x3e,0x08,0x08},   // + 0x2b 43

等等...

我对这段代码的工作方式感到非常困惑 - 有人可以向我解释一下吗?

I am very confused as to how this code works - can someone explain it to me please?

谢谢,

马吉德

推荐答案

每个 5 字节数组 = 40 位,映射到字符网格中的 7x5 = 35 像素(大概有 5 个未使用的位).

Each array of 5 bytes = 40 bits which map to the 7x5 = 35 pixels in the character grid (there are 5 unused bits presumably).

当您想显示一个字符时,您可以将该字符对应的 5 字节位图复制到适当的内存位置.例如.要显示字符 X,您需要从 font['X'] 复制数据.

When you want to display a character you copy the corresponding 5 byte bitmap for that character to the appropriate memory location. E.g. to display the character X you would copy the data from font['X'].

这篇关于LED 模块的 ASCII 7x5 侧馈字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆