Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / test / testencoders.c @ 867

History | View | Annotate | Download (500 Bytes)

1
#include <dragonfly_lib.h>
2
#include "spi.h"
3
#include "encoders.h"
4

    
5
#define MODE 0
6
#define TEST 0
7

    
8
extern char spi_status;
9

    
10
int testencoders(void)
11
{
12
        usb_init();
13
        encoders_init();
14
        dragonfly_init(ALL_ON);
15
        int encoder_left,encoder_right;
16
        while(1){
17
                
18
                encoder_left = encoder_read(LEFT);
19
                encoder_right = encoder_read(RIGHT);
20
                usb_puts("Encoder values (left, right): ");
21
                usb_puti(encoder_left); 
22
                usb_puts(", ");
23
                usb_puti(encoder_right); 
24
                usb_puts("\n\r");
25
                delay_ms(500);
26
        }
27
        return 0;
28
}
29