Gast
#1034996
Hallo.. Ich bin halt anfänger und kenne mich nicht so gut mit dem sache(meine deutsche sprache ist auch nicht so toll bitte um verständnes) ich benutze Atmage8 folgnede program soll dem LED auf PORTB 10 mal blinken lassen ,falls ich dem 5v von dem PC0 wegnehme es funktoniert aber nicht wenn ich dem programm auf dem Atmega 8 programiere dann blinkt dem LED auf PORTB 10 mal und dann reagiert nicht mehr #include <avr/io.h> #include <stdint.h> #include <avr/io.h> #include <util/delay.h> int main (void) { DDRD = 0X03; PORTD = 0x00; DDRB = 0xff; // (3) PORTB = 0x03; DDRC = 0X00; PORTC = 0x00; // (4) while(1) { if (PC0 <((1024.0/5.0)*3)) { for(int n = 0; n < 10; ++n) { // PORTD ^= ( 1 << PD1 ); // _delay_ms(500); PORTD ^= ( 1 << PD1 ); _delay_ms(500); } } return 0; } }