void Send_Debug_Packet(void) { // These will hold the string versions of our // left/right encoder click counts. Used when we // ship out the data packet. char left_encoder_string[8]; char right_encoder_string[8]; char packet[20]; char delimiter[1]; char newline[5]; packet[0] = '\0'; // Get the current number of left encoder // clicks left_encoder_clicks = Left_Encoder_Count(); // Convert that long into a string ltoa(left_encoder_clicks, left_encoder_string, 10); // Get the current number of right encoder // clicks right_encoder_clicks = Right_Encoder_Count(); // Convert it into a string ltoa(right_encoder_clicks, right_encoder_string, 10); // Construct the debug data packet // The left encoder value strcat(packet, left_encoder_string); // Simple delimiter, used to seperate values. delimiter = ' '; strcat(packet, delimiter); // Right encoder value strcat(packet, right_encoder_string); // Ending line, creates a new line for the next // packet newline = '\r\n'; strcat(packet, newline); // Send packet print(packet); }