Project

General

Profile

Revision 1362

Added test for usb output functions

View differences:

trunk/code/projects/test/main.c
1
extern int testusb();
1 2
extern int testlcd();
2 3
extern int testrangefinders();
3 4
extern int testanalog();
......
5 6
extern int testmotors();
6 7

  
7 8
int main(void) {
9
  testusb();
8 10
  //testlcd();
9 11
  //testrangefinders();
10 12
  //testanalog();
11
  testtokenring();
13
  //testtokenring();
12 14
  //testencoders();
13 15
  //testlights();
14 16
  //testmotors();
trunk/code/projects/test/testusb.c
1
#include <dragonfly_lib.h>
2

  
3
/*
4
 * This function outputs to TeraTerm the following:
5
 *
6
 * Testing...
7
 * 1, 2, 3
8
 * 2A, F4, C8E1
9
 * done.
10
 * 
11
 */
12

  
13
int testusb(void) {
14

  
15
	dragonfly_init(ANALOG);
16
	
17
	usb_init();
18
	usb_puts("usb turned on, test starting:\r\n");
19
  
20
	usb_puts("\r\n\n");
21
	delay_ms(1000);
22
	
23
	// print some values to usb
24
  usb_puts("Testing...\n");
25
  usb_puti(1);
26
  usb_putc(',');
27
  usb_putc(' ');
28
  usb_puti(2);
29
  usb_putc(',');
30
  usb_putc(' ');
31
  usb_puti(3);
32
  usb_putc('\n');
33
  usb_puth8(0x2A);  
34
  usb_putc(',');
35
  usb_putc(' ');
36
  usb_puth16(0xF4);
37
  usb_putc(',');
38
  usb_putc(' ');
39
  usb_puth(0xC8E1);
40
  usb_putc('\n');
41
  usb_puts("done.\n");
42
  
43

  
44
  /* TODO: add test for getting values from usb */
45
  
46
  
47
	return 0;
48
}

Also available in: Unified diff