Project

General

Profile

Statistics
| Revision:

root / trunk / code / behaviors / encoder_test / main.c @ 1914

History | View | Annotate | Download (468 Bytes)

1
/*
2
 * Streams back encoder values while the user manually turns the wheels.
3
 */
4

    
5
#include <dragonfly_lib.h>
6

    
7
int main(void)
8
{
9

    
10
        dragonfly_init(ALL_ON);
11
        
12
        orbs_set_color(GREEN, CYAN);
13

    
14
    int left = 0;
15
    int right = 0;
16

    
17
        while (1) 
18
    {
19
        left = encoder_get_dx(LEFT);
20
        right = encoder_get_dx(RIGHT);
21

    
22
        usb_puts("LEFT: ");
23
        usb_puti(left);
24
        usb_puts(", RIGHT: ");
25
        usb_puti(right);
26
        usb_puts("\n");
27
        }
28

    
29
        return 0;
30
}
31