MCU总工 发表于 2025-6-17 09:07:57

全屏高级quote-cjk-patch2BIUColorBgColorUrl AutotypesetLeftCenterRight 表情图片

51单片机系列(30天计划)Day1:让数码管显示"7"手把手教学:
[*]认识共阳数码管:
https://example.com/7seg.png

[*]a~g段对应LED,公共端接VCC
[*]Proteus仿真步骤:
[*]放置AT89C51、7SEG-COM-ANODE、RES
[*]连接P2口到a~g(注意段码顺序)

[*]代码编写:c


复制


下载





#include <reg52.h>void main() {    P2 = 0xF8; // 显示数字7(共阳段码)    while(1);}

实物操作:
[*]用万用表蜂鸣档测试数码管引脚对应段
[*]

页: [1]
查看完整版本: 全屏高级quote-cjk-patch2BIUColorBgColorUrl AutotypesetLeftCenterRight 表情图片