Jetzt bin ich wirklich durcheinander
Warum ?
Ich glaube es liegt eher daran, daß Du Anfänger in Sachen C u. µC bist, oder ?
Ich versuche Dein Programm etwas abzuändern:
Code:
#include <avr/io.h>
#include <stdint.h>
int main(void) {
DDRD=(1<<PD2)|(1<<PD3)|(1<<PD5);
DDRB = (1<<PB1);
PORTB = (1<<PB3);
TCCR1A = (1<<COM1A1)|(1<<WGM10)|(1<<WGM12);
TCCR1B = (1<<CS10);
while(1) {
if ( PINB & ( 1<<PINB3 ) ) {
PORTD |= (1<<PD2)|(1<<PD5);
OCR1A = 128;
}
else {
PORTD &= ~((1<<PD2)|(1<<PD5)); // LED aus "Test"
OCR1A = 0;
}
}
return 0;
}
Ich sag mal so, das müsste klappen
Gruß Sebastian
Lesezeichen