Project

General

Profile

Statistics
| Revision:

root / branches / rbom / code / projects / template / main.c @ 783

History | View | Annotate | Download (454 Bytes)

1
#include <dragonfly_lib.h>
2

    
3
int main(void) {
4
        dragonfly_init(ALL_ON);
5
        orb_init();
6
        orb_enable();
7
        bom_on();
8
        orb1_set_color(RED);
9
        char l0, l1, h0, h1, on;
10
        int mask;
11
        while(1)
12
        {
13
                l0 = usb_getc()&0xf;
14
                l1 = usb_getc()&0xf;
15
                h0 = usb_getc()&0xf;
16
                h1 = usb_getc()&0xf;
17
                on = usb_getc();
18
                mask = l0|(l1<<4)|(h0<<8)|(h1<<12);
19
                usb_puti(mask);
20
                usb_putc('\n');
21
                bom_set_leds(mask);
22
                if(on == 'o')
23
                        bom_on();
24
                else
25
                        bom_off();
26
        }
27
        return 0;
28
}