#define uchar unsigned char
#define uint unsigned int
uchar Table[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar Da
uchar Da
void DelayMs(uint i) //0.25ms
{uchar j;
for(;i!=0;i--)
{for(j=250;j!=0;j--) {;}}
}
void Display(uchar *p) //间隔5ms显示
{uchar i,sel=0x01;
for(i=0;i<4;i++)
{PORTA=sel;
PORTC=0xff-Table[p[i]];
DelayMs(20);
sel=sel<<1;
}
}
void main(void)
{uint i;
DDRA=0xff; //Set port A to input without pull-up;
PORTA=0xff;
DDRC=0xff; //Set port C to push-pull 1 output;
PORTC=0xff;
DDRD=0xff; //Set port D to pull-up input
PORTD=0xff;
PORTA=0xff;
PORTC=0x00;
DelayMs(10000);
MCUCR=0x00;//Falling edge
GIMSK=0x40;//int0
GIFR=0xff;
SREG=SREG|0x80;
while(1){Display(Da
/*{if((GIFR&0x40)==0x40) {GIFR=0xff;Display(Da
else
}*/
} ta);}
Previous article:ARM9 storage structure
Next article:AVR Eeprom C language programming
Recommended ReadingLatest update time:2024-11-16 22:47
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How does the SPI bus work?
- Xiaomi Mi Band 3 Disassembly
- 17 "Ten Thousand Miles" Raspberry Pi Car——VSCode Learning (Compiling and Debugging)
- MOS tube VBE1606\VBN1603 in the design of driving circuit of medical temperature control blanket control system
- Could you please tell me what brand this chip is?
- Chip company recruitment: power hardware engineer
- [RVB2601 creative application development] + voice prompt type environmental status detection recorder
- Research on the information performance advantages of Suruide in-vehicle Ethernet hardware and applications
- [Synopsys IP Resources] Prototyping as a Service (PaaS): Breaking through chip design process bottlenecks and simplifying the path to innovation
- How to write the test bench file for the verliog10 divider