Project

General

Profile

Statistics
| Revision:

root / branches / library_refactor / projects / test / test_encoders.c @ 1366

History | View | Annotate | Download (475 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
        int encoder_left,encoder_right;
15
        while(1){
16
                
17
                encoder_left = encoder_read(LEFT);
18
                encoder_right = encoder_read(RIGHT);
19
                usb_puts("Encoder values (left, right): ");
20
                usb_puti(encoder_left); 
21
                usb_puts(", ");
22
                usb_puti(encoder_right); 
23
                usb_puts("\n\r");
24
                delay_ms(500);
25
        }
26
        return 0;
27
}
28