16 16点阵显示程序(含电路图)

16 16点阵显示程序
以下是程序.
#includeconfig.h
#definedotled_line_portportb
#definedotled_line_ddrddrb
#definedotled_line_pinpinb
#definedotled_line_scktpb1
#definedotled_line_sckhpb5
#definedotled_line_sdapb3
#definedotled_row_portportc
#definedotled_row_ddrddrc
#definedotled_row_pinpinc
#definedotled_row_a0pc0
#definedotled_row_a1pc1
#definedotled_row_a2pc2
#definedotled_row_a3pc3
#definedotled_row_epc4
uint8font[]={
/*--调入了一幅图像:这是您新建的图像--*/
/*--宽度x高度=16x16--*/
0x00,0x00,0x00,0x00,0x08,0x38,0x18,0x44,0x08,0x44,0x08,0x04,0x08,0x08,0x08,0x10,
0x08,0x20,0x08,0x40,0x08,0x40,0x08,0x40,0x3e,0x7c,0x00,0x00,0x00,0x00,0x00,0x00
};
staticvoidtransmitbyte(uint8byte);
staticvoidselectrow(uint8row);
staticvoidfliplatchline(void);
staticvoidtransmitbyte(uint8byte)
{
uint8i;
for(i=0;i<8;i++)
{
if(byte&(1<{
dotled_line_port|=_bv(dotled_line_sda);
}
else
{
dotled_line_port&=~_bv(dotled_line_sda);
}
//__delay_cycles(100);
dotled_line_port|=_bv(dotled_line_sckh);
//__delay_cycles(100);
dotled_line_port&=~_bv(dotled_line_sckh);
//__delay_cycles(100);
}
}
staticvoidselectrow(uint8row)
{
//row-=1;
row|=dotled_row_pin&0xe0;
dotled_row_port=row;
}
staticvoidfliplatchline(void)
{
dotled_line_port|=_bv(dotled_line_sckt);
dotled_line_port&=~_bv(dotled_line_sckt);
}
voidinitdotledport(void)
{
dotled_line_port&=~(_bv(dotled_line_sckt)|_bv(dotled_line_sckh));
dotled_line_port|=_bv(dotled_line_sda);
dotled_line_ddr|=_bv(dotled_line_sckt)|_bv(dotled_line_sckh)|_bv(dotled_line_sda);
dotled_row_port|=0x1f;
dotled_row_port&=0xf0;
dotled_row_ddr|=0x1f;
}
voidenablerow(booleanisenable)
{
if(isenable)
{
dotled_row_port&=~_bv(dotled_row_e);
}
else
{
dotled_row_port|=_bv(dotled_row_e);
}
}
voidprintdotled(uint8*buffer)
{
uint8i,tmp;
for(i=0;i<16;i++)
{
tmp=*buffer++;
transmitbyte(~tmp);
tmp=*buffer++;
transmitbyte(~tmp);
selectrow(i);
fliplatchline();
}
}
voidmain(void)
{
initdotledport();
enablerow(true);
while(1)
{
printdotled(font);
__delay_cycles(5000);
}
}
//---------------------------------------------------------------------------
config.h文件
#ifndef_config_h
#define_config_h
//#definegccavr
#definecpu_cycles7372800l
#ifndefgccavr
#define_bv(bit)(1<<(bit))
#endif
#definemsb0x80
#definelsb0x01
#definefalse0
#definetrue1
typedefunsignedcharuint8;
typedefunsignedintuint16;
typedefunsignedlonguint32;
typedefunsignedcharboolean;
#include
#include
#includedotled.h
#endif
//---------------------------------------------------------------------------
16 16点阵显示电路

低功耗4G新品模组——合宙Air780EX,1618小尺寸LCC封装
点电荷电场中的电场线_点电荷的电场线分布
华微电子未按规定回复监管函件,上交所予以警示
虚拟现实产品明年或大爆发 产业巨头纷纷加入战团
超高电阻、电阻率和绝缘材料的精确测量
16 16点阵显示程序(含电路图)
只用一个OP放大器的基本差动放大器
炬芯科技智能手表芯片已获多个知名品牌采用
传韩国空芯锂离子电池公司为苹果提供汽车电池
如何用脚本文件拆分多模板的SaberMAST文件?
魅蓝Note与魅蓝Note2有哪些区别
腾讯市值1月峰值以来下跌25%蒸发1400亿美元
FF91还要闯三关?FF和特斯拉的差别在哪?
大模型为什么是深度学习的未来?
陆芯IGBT用于各类高频电源产品
MySQL为字段选择合适数据类型
东软载波变频风机应用助力客户产品在减碳降耗方面做“减法”
iPhone8将通过双卡双待和双曲面屏向安卓机皇三星手机逼近
这几家芯片商加强布局,瞄准车用半导体市场
正式确认Redmi K30 Pro将采用Snapdragon 865 SoC