main.c 536 Bytes
Newer Older
1 2 3 4
#include "sam.h"

int main (void) {
    int i;
Erik Strand's avatar
Erik Strand committed
5 6 7 8 9 10 11

    // on a squidworks module board, the red LED is 17, and the green is 19
    REG_PORT_DIR0 = (1u << 17) | (1u << 19);

    // setting these high turns the LEDs off
    REG_PORT_OUTSET0 = (1u << 17) | (1u << 19);

12
    while(1) {
Erik Strand's avatar
Erik Strand committed
13 14
        REG_PORT_OUTSET0 = (1u << 17) | (1u << 19);
        for (i=0; i<1000000; i++) {
15 16
            __asm("nop");
        }
Erik Strand's avatar
Erik Strand committed
17 18 19

        REG_PORT_OUTCLR0 = (1u << 17) | (1u << 19);
        for (i=0; i<1000000; i++) {
20 21 22 23
            __asm("nop");
        }
    }
}