uint8_t DIS_Play_dat[][32]= { {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",0*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",1*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",2*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",3*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",4*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",5*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",6*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",7*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",8*/ {0x00,0xFD,0x00,0x80,0x01,0x80,0xFF,0x80,0x01,0x80,0x00,0x70,0x11,0x88,0x11,0x88,0xFF,0x00,0x1F,0x06,0x80,0x01,0x80,0x06,0x1F,0x00,0x81,0x42,0x3C,0x3C,0x42,0x81},/*"?????",9*/ }; //¶ÔÏÔʾ×Ö·ûÖ¸¶¨ÑÕÉ« //Num£ºÐèÒªÏÔʾÄÚÈÝ //color£ºÑÕÉ« void DIS_Num(uint8_t Num,uint32_t color) { uint8_t sec=0,k=0,n; for(sec=0;sec<32;sec++) { k=DIS_Play_dat[Num][sec]; for(n=0;n<8;n++) { if(k>>7) { SPI_Send24Bit(color); } else { SPI_Send24Bit(0x000000); } k=k<<1; } } }
时间: 2023-09-27 22:12:48 浏览: 88
C实现与 uint64_t 相同功能的类
这段代码是用于在显示屏上显示数字的函数,使用了一个二维数组 `DIS_Play_dat` 存储数字的显示信息。`Num` 参数指定要显示的数字,`color` 参数指定显示的颜色。该函数使用 SPI 接口将颜色信息发送到显示屏上。具体来说,它通过循环遍历 `DIS_Play_dat` 数组中对应数字的每一行数据,并将每个像素的颜色信息逐个发送到显示屏上,以达到显示数字的效果。
阅读全文