![]() |
|
|
#1 |
|
Nhập môn đệ tử
Tham gia ngày: Nov 2008
Bài gửi: 5
: |
chương trình này em viết trên MikroC 8.2
Code:
void main() {
PORTA = 0; // Initialize PORTA
TRISA = 0; // Configure PORTA as output
PORTB = 0; // Initialize PORTB
TRISB = 0; // Configure PORTB as output
PORTC = 0; // Initialize PORTC
TRISC = 0; // Configure PORTC as output
PORTD = 0; // Initialize PORTD
TRISD = 0; // Configure PORTD as output
while(1) {
PORTA = ~PORTA; // toggle PORTA
Delay_ms(1000); // one second delay
PORTB = ~PORTB; // toggle PORTB
Delay_ms(1000); // one second delay
PORTC = ~PORTC; // toggle PORTC
Delay_ms(1000); // one second delay
PORTD = ~PORTD; // toggle PORTD
Delay_ms(1000); // one second delay
}
}
|
|
|
|
|
|