<
// *********************************************************** // Project: // Author: // Module description: // *********************************************************** #include <avr\io.h> // Most basic include files #include <avr\interrupt.h> // Add the necessary ones #include <avr\signal.h> // here #include <util/delay.h> // Define here the global static variables // int My_global; // Interrupt handler example for INT0 // SIGNAL(SIG_INTERRUPT0) { } // It is recommended to use this coding style to // follow better the mixed C-assembly code in the // Program Memory window // void my_function(void) { // Put the open brace '{' here asm("nop"); // Inline assembly example } // *********************************************************** // Main program // int main(void) { DDRB|=0xff; PORTC=(1<<1)|(1<<2); //PORTB=(1<<4); while(1) { if(PINC&(1<<PC1)) { PORTB=0X55; delay_ms(2000); PORTB=0XAA; delay_ms(1000); } if(PINC&(1<<PC2)){ PORTB=0X55; delay_ms(2000); PORTB=0XAA; delay_ms(2000); } } } void delay_ms (int d ) { //while(1); }
can someone tell me why LED is not toggling every 1 and 2 sec?
must have tried indefinite times :(