U23 2007/Inhalt Abend 2/Binär durchzählen

From C4 Wiki
< U23 2007‎ | Inhalt Abend 2
Revision as of 21:47, 14 May 2007 by 87.79.236.180 (talk) (New page: #include <avr/io.h> int main(void) { DDRA = 0xFF; PORTA = 0x00; while (1) { PORTA *= 2; if(PORTA == 0x00) { PORTA = 0x01; ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#include <avr/io.h>

int main(void) {
DDRA = 0xFF;
PORTA = 0x00; 

    while (1) {
        PORTA *= 2;
        if(PORTA == 0x00)
        {
                PORTA = 0x01;
        }  

        uint16_t i;
        uint16_t j; 

        for (i = 0; i < 5; i++) {
            for (j = 0; j < 0xffff; j++) {
                /* nix */
            }
        }
    } 

    return 0;
}