0x是16进制数的意思,0xf8和0xfa分别表示十进制的263和265,16进制数是用来运算或收发等处理的,不存在如何设置的问题,因为函数sendbyte()用来发送一个字节,而这个字节必须以16进制表示,所以不能写成sendbyte(263),必须转成0xf8.
举个例子,我们向一个没有汉字库的12864屏上发送“欢迎”三字,就要发送下面的16进制数:
/* 欢*/
0x14,0x24,0x44,0x84,0x64,0x1C,0x20,0x18,0x0F,0xE8,0x08,0x08,0x28,0x18,0x08,0x00,
0x20,0x10,0x4C,0x43,0x43,0x2C,0x20,0x10,0x0C,0x03,0x06,0x18,0x30,0x60,0x20,0x00,
/*迎*/
0x40,0x41,0xCE,0x04,0x00,0xFC,0x04,0x02,0x02,0xFC,0x04,0x04,0x04,0xFC,0x00,0x00,
0x40,0x20,0x1F,0x20,0x40,0x47,0x42,0x41,0x40,0x5F,0x40,0x42,0x44,0x43,0x40,0x00,
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)