Project

General

Profile

Revision 1239

Added by Rich Hong over 13 years ago

small changes to spline server code

View differences:

server.c
65 65
	write(serialFileOut, &senderNum, 1);
66 66
	
67 67
	//Sending velocity as LS LD RS RD
68
	int tempCount = 0;
68
	int tempCount = 190;
69 69

  
70 70
	int dx, left_v;
71 71
	
......
73 73
	{
74 74
		printf("SENDING DATA\n");
75 75
		encoders[LS] = tempCount;
76
		encoders[LD] = 1;
76
		encoders[LD] = 0;
77 77
		encoders[RS] = tempCount;
78 78
		encoders[RD] = 0;
79
		tempCount += 50;
79
		//tempCount += 50;
80 80
		int temp = 0;
81 81
		int count = 0;
82 82
		do
......
87 87
				perror("Write Error");
88 88
			count += temp;
89 89
			printf("sent: %d\n", count);
90
			usleep(100);
90
			usleep(200);
91 91
		}while(count < 4);
92 92
		count = 0;
93 93
		printf("READING DATA\n");
......
96 96
			count += read(serialFileIn, encoders, 4);
97 97
		}while(count < 4);
98 98
		
99
		int leftEncoder = (encoders[0] << 8) | encoders[1];
100
		int rightEncoder = (encoders[2] << 8) | encoders[3];
101
//		printf("%d %d\n", leftEncoder, rightEncoder);
99
		short leftEncoder = (encoders[0] << 8) | encoders[1];
100
		short rightEncoder = (encoders[2] << 8) | encoders[3];
101
		printf("%d %d\n", leftEncoder, rightEncoder);
102 102

  
103
		encoder_recv(leftEncoder, rightEncoder);
104
		printf("LEFT V: %d \t RIGHT V: %d\n", encoder_get_v(LEFT), encoder_get_v(RIGHT));
103
//		encoder_recv(leftEncoder, rightEncoder);
104
//		printf("LEFT V: %d \t RIGHT V: %d\n", encoder_get_v(LEFT), encoder_get_v(RIGHT));
105 105

  
106 106

  
107 107

  

Also available in: Unified diff