求助,我想让仿真数码管动态显示,加了pnp三极管后总仿真不出结果(三极管一定要有),请问那个有问题?

weixin_44208772 2019-04-23 11:56:32
#include <reg51.h>
#include <stdio.h>
#define uint unsigned int
#define uchar unsigned char
sbit p36=P3^6;

uchar code cc[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar code addr[]={0x0f0,0x0f1,0x0f2,0x0f3};
void delay (uint i)
{while(i--)
;
}
void main(void)
{
uchar vv[4];
p36=1;

vv[0]=4;
vv[1]=6;
vv[2]=7;
vv[3]=3;
while (1)
{
uchar i;
i=4;
while(i--)
{


P2=addr[3-i];
P0=cc[vv[3-i]];
if (i==1)
{
P0=cc[vv[3-i]] | 0x80;
}
p36=0;
delay(50);
p36=1;

}
}
}
...全文
315 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yishumei 2019-04-24
  • 打赏
  • 举报
回复
楼主在三极管B级和C、E两端加两个电压测量表,看看三极管是否导通关闭,导通和关闭时Vce有没变化。
  • 打赏
  • 举报
回复

27,375

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
  • 单片机/工控社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧