- 打卡等级:初来乍到
- 打卡总天数:4
- 最近打卡:2025-04-01 05:26:28
已绑定手机
注册会员
- 积分
- 80
|
发表于 2025-2-2 01:44:44
|
显示全部楼层
Pujiang Yishui Posted on 2024-12-5 20:53Thanks
to the two moderators of "Guoxue Xinyong" and "" for their encouragement and support, as well as the praise of friends upstairs.
The second experimental procedure is about the digital tube display ...
感谢你分享的示例。我正在调整适配PHz-51 A3。这种方案对LET数码管有所不同,基于74HC138驱动,组合使用P2.2、P2.3、P2.4端口和P0端口的LED1-LED8。
u8 code T_COM[]={ 0x1c, 0x18,0x14,0x10,0x0C,0x08,0x04,0x00 }; // Mask digit codes for P2 port (P2.2 P2.3 P2.4)
// LED1,LED2,LED3,LED4,LED5,LED6,LED7,LED8
//********************** Display scan function ************************
void DisplayScan(void)
{
P2 &= 0xE3; // Clear the mask 0xE3 on P2 bit
// (P2.2 = 0 P2.3 = 0 P2.4 = 0)
P2 |= T_COM[DispN]; // Activate LED(DispN) segment
P0 = LED8[DispN]; // Write LED digits on current segment
if (++DispN >= 8) DispN = 0; // Reset to 0 after 8 digits
}
|
|