Project

General

Profile

Revision 1443

Added by Ryan Cahoon about 7 years ago

1. Alpha code to trigger the new wireless bootloader from the user program. Not tested
Includes subroutine in the XBee library to reset the XBee's settings

2. New subroutine in the BOM library to more accurately estimate the position of the max reading using weighted average of the readings instead of max reading.
Also roughly estimates distance to BOM-detected robot based on signal strength

View differences:

wl_token_ring.c
738 738
 **/
739 739
static void wl_token_bom_on_receive(int source)
740 740
{
741
	int max, dist;
742

  
741 743
	WL_DEBUG_PRINT("Robot ");
742 744
	WL_DEBUG_PRINT_INT(source);
743 745
	WL_DEBUG_PRINT(" has flashed its bom.\r\n");
744 746

  
745 747
	bom_on_count = 0;
746 748

  
749
	max = get_max_bom_function();
747 750
	sensor_matrix_set_reading(wl_get_xbee_id(),
748
		source, get_max_bom_function());
751
		source, max);
752

  
753
	WL_DEBUG_PRINT("Max: ");
754
	WL_DEBUG_PRINT_INT(max);
755
	WL_DEBUG_PRINT("\tVar: ");
756
	WL_DEBUG_PRINT_INT(dist);
757
	WL_DEBUG_PRINT("\n\n");
749 758
}
750 759

  
751 760
/**

Also available in: Unified diff