字模竖置横排转横置横排循环

张开发
2026/5/19 19:48:50 15 分钟阅读
字模竖置横排转横置横排循环
竖置横排转横置横排循环------*//*PAST 2015 10 2 1835L58 CODE 1290**/#include reg51.h#include intrins.h#include stdio.h#define uchar unsigned char#define uint unsigned intuchar f;uchar fontbuf;uchar newbuff[32]; //将字库中读出的数据进行转换uchar code fontbuff[]{0XF8,0X04,0X02,0X02,0X02,0X04,0X08,0X10,0X10,0X08,0X04,0X02,0X02,0X02,0X04,0XF8,0X00,0X01,0X02,0X04,0X08,0X10,0X20,0X40,0X40,0X20,0X10,0X08,0X04,0X02,0X01,0X00}; //定义数组a 循环总变量ivoid main(){uint s,m;uchar i,k;uchar step,structure;uchar buff;fontbuf0;SCON0x50; //串口工作方式TMOD|0x20; //确定定时器工作模式TH10xF3;TR11; //开启定时器1TI1; //_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();while(1){m0;for(structure0;structure2;structure){for(step0;step8;step) //每横向16列运行8步把8步合并横置横排16字节。{for(k0;k2;k){fontbuf0; //初始化 字节运算寄存器等于0for(i0;i8;i) //第一层循环取竖置当前移出的8个点。{si(k*8)(structure*16);printf(s%d\n,s);bufffontbuff[s]step;//右移次数fontbufbuff0x01;fontbuf7-i;}newbuff[m]fontbuf;printf(m%d\n,m);printf(fontbuf%d\n,fontbuf);m; //字符表寻址地址加1}}}for(f0;f32;f){fontbufnewbuff[f];printf(fontbuf%d\n,fontbuf);}}}

更多文章