Name: 8-Digit Display of Different Characters
Software: Proteus
Keil 4
Language: C Language
Usage Instructions: In this example, through the Proteus simulation named: 8-Digit display dynamically shows multiple different characters, dynamically scanning to display 0~7.
Example Image:
Proteus Simulation – 8-Digit Display of Different Characters
Code:
/* Name: 8-Digit Display of Different Characters
Description: The display scans dynamically to show 0~7.
*/
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
// Delay function
void DelayMS(uint x)
{
uchar t;
while(x–) for(t=0;t<120;t++);
}
// Main program
void main()
{
uchar i,wei=0x80;
while(1)
{
for(i=0;i<8;i++)
{
P0=0xff;
P0=DSY_CODE[i]; // Send segment code
wei=_crol_(wei,1);
P2=wei; // Send position code
DelayMS(2);
}
}
}
/***************Gorgeous Divider***********************/
Program:
Proteus software is an EDA tool developed by Labcenter Electronics in the UK, which serves as a next-generation electronic design platform, integrating teaching, experimentation, and design; the software includes functions for electrical and electronic simulation design, electronic technology simulation design, and microcontroller application design validation. It runs on the Windows operating system and can simulate and analyze (SPICE) various analog devices and integrated circuits.
The Proteus tutorial resource website (proteuseda.com) was established in 2018. The webmaster, as an electronic engineer, is dedicated to promoting the development of electronic design automation in China, collecting and sharing various excellent Proteus simulation tutorials and materials. It aims to contribute to China’s intelligent manufacturing.
/*******************************************/
Click the bottom right corner “Read Original” to get more simulation examples