Gast
#836089
Hallo, ich möchte gerne, das der MCU, alle LEDs auf Port B ein schaltet und und nach einer weil (ca 2sek) wieder alles aus schaltet. Die Funkionen alleine all_on und all_off funktionieren problemlos, nur die Warte funktion pa wird irrgend wie ignoriert. Habt ihr einen, kleinen TIP für mich? // MCU Typ: AT90S4433 #include <avr/io.h> //_________warte Schleife____________________ void pa() { int x; // legt varieable x fest x=0; // hat den wert 0 while (x<3000) // x kleiner 3000 { x++; // erhöhe um jwals um eins } } //_________alle LEDs an_______________________ void all_on() { DDRB = 0xff; // Register auf Ausgang PORTB = 0x00; // Alle LED an } //_______________alle LEDs aus_________________ void all_off() { DDRB = 0xff; // Register auf Ausgang PORTB = 0xff; // Alle LED an } //_______Hauptprogramm_________________________ int main (void) { all_on(); // all LEDs an pa(); // kleine pause all_off();// Alles LEDs aus return 0; }