#include
while(1)
if((PIND&0x0F)!=0x0F);
Delayms(5);
if((PIND&0x0F)!=0x0F)
{
if((PIND&0x01)==0)
PORTA&=~(1<
if((PIND&0x02)==0)
PORTA&=~(1<
if((PIND&0x04)==0)
PORTA&=~(1<
if((PIND&0x08)==0)
PORTA&=~(1<
Delayms(5);
while((PIND&0x0F)!=0x0F);
PORT = 0xFF;
}
uint i,j;
for( i=0;i
for(j=0;j<1141;j++);
Keywords:AVR128
Reference address:AVR128 program - independent button control LED flashing
#include
#define uchar unsigned char
#define uint unsigned int
void Delayms(uint MS);
void main(void)
{
DDRA = 0XFF;
PORT = 0XFF;
DDRC=0XFF;
PORTC=0XFF;
DDRF|=0X0E;
PORTF|=0X0E;
PORTF&=0xF8;
DDRD = 0x00;
PORTD = 0XFF;
DDRB |= 0X10;
PORTB |= 0X10;
{
}
}
void Delayms(uint MS)
{
}
Previous article:AVR128 Program - Timer
Next article:AVR128 program - independent button control buzzer
- Popular Resources
- Popular amplifiers
- Example interpretation of 51 single chip microcomputer complete learning and application
- Example interpretation of 51 single chip microcomputer complete learning and application
- Application of AVR microcontroller Atmega128 in FPGA configuration
- AVR microcontroller atmega128 controls the angle of the servo sg90
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
Guess you like
- The water pump stops accidentally
- [Project source code] FPGA-based cmos_init OV5640 camera I2C interface controller
- Can the outputs of several LDO chips be connected in parallel?
- 《Arduino+Android Interactive Smart Work: Getting Started with the Internet of Things》
- [ESK32-360 Review] Hetai and Blood Pressure Algorithm Transplantation (2)
- Smart manufacturing hopes to connect the future | Listen to TE talk about the technological innovation behind smart manufacturing and future transportation
- Showing Goods (3) - Antique Development Board
- [Environmental Expert's Smart Watch] Part 4: OLED drive and automatic interface switching
- R7F0C009 comparator configuration problem
- About antenna receiving power and power amplification