Project

General

Profile

Revision 1345

Added by Rich Hong almost 11 years ago

Final spline code for master/slave

updated outdated libdragonfly and libwireless

View differences:

master.c
23 23
PacketGroupHandler packetHandler = {GROUP, 0, 0, &packet_receive, 0};
24 24

  
25 25
void packet_receive (char type, int source, char* packet, int length) {
26

  
27 26
	if(type == ENCODER)
28 27
	{ 
29 28
		if(id == -1)
......
32 31
			motor1_set(1, 200);
33 32
		usb_putc(packet[0]);
34 33
		usb_putc(packet[1]);
35
//		usb_putc(packet[2]);
36
//		usb_putc(packet[3]);
37 34
	}                                  
38
	
39 35
}
40 36

  
41 37
int main (void) {
......
55 51
		lcd_puts("starting init");
56 52
		data[0] = usb_getc(); 
57 53
		data[1] = usb_getc();
58
		//data[2] = usb_getc();
59
		//data[3] = usb_getc();
60
		
54

  
61 55
		lcd_puts("Done with init\n");
62 56

  
63 57
		wl_send_global_packet(GROUP, MOTOR, data, 2, 0);
......
67 61
		wl_register_packet_group(&packetHandler);
68 62
	}
69 63

  
70
//	lcd_clear_screen();
71
  while (1) {
72
  if(position == SENDER)
73
  {
74
		data[0] = usb_getc(); 
75
		data[1] = usb_getc();
76
		//data[2] = usb_getc();
77
		//data[3] = usb_getc();
78
		wl_send_global_packet(GROUP, MOTOR, data, 2, 0);
79
	}	
64
	while (1) {
65
		if(position == SENDER)
66
		{
67
			data[0] = usb_getc(); 
68
			data[1] = usb_getc();
69
			wl_send_global_packet(GROUP, MOTOR, data, 2, 0);
70
		}        
80 71

  
81
	  wl_do();
82
  }
83
  
72
		wl_do();
73
	}
74

  
84 75
}
85
                                                   
76

  

Also available in: Unified diff