Project

General

Profile

Revision 137

Updated recharing, software somewhat works.

View differences:

recharge.c
30 30
void recharge_init(void)
31 31
{
32 32
	wl_recharge_register();
33
	//TODO: uncomment to use homing sensor
34 33
	recharge_i2c_init();
35 34
}
36 35

  
......
93 92
		{
94 93
			case NOT_RECHARGING:
95 94
				RECHARGE_DEBUG_PRINT("Not recharging.\n");
96
				orb_set_color(GREEN);
95
				//orb_set_color(GREEN);
97 96
				break;
98 97
			case POLLING:
99 98
				RECHARGE_DEBUG_PRINT("Polling available stations.\n");
100
				orb_set_color(CYAN);
99
				//orb_set_color(CYAN);
101 100
				break;
102 101
			case REQUESTING:
103 102
				RECHARGE_DEBUG_PRINT("Requesting a station.\n");
104
				orb_set_color(RED);
103
				//orb_set_color(RED);
105 104
				break;
106 105
			case SEEKING:
107 106
				RECHARGE_DEBUG_PRINT("Seeking.\n");
108
				orb_set_color(YELLOW);
107
				//orb_set_color(YELLOW);
109 108
				break;
110 109
			case DOCKED:
111 110
				RECHARGE_DEBUG_PRINT("Docked.\n");
112
				orb_set_color(BLUE);
111
				//orb_set_color(BLUE);
113 112
				break;
114 113
			case DEPARTING:
115 114
				RECHARGE_DEBUG_PRINT("Departing.\n");
116
				orb_set_color(PURPLE);
115
				//orb_set_color(PURPLE);
117 116
				break;
118 117
			default:
119 118
				WL_DEBUG_PRINT("Unexpected state.\n");
......
155 154
	//TODO: check if battery is charging
156 155
	//if (battery is charging)
157 156
	if (button2_click())
157
	{
158 158
		wl_recharge_dock();
159
		move(0, 0);
160
	}
159 161
}
160 162

  
161 163
/**
......
169 171
	//if (battery is charged)
170 172
	if (button2_click())
171 173
	{
172
		motors_off();
173 174
		wl_recharge_depart();
174 175
	}
175 176
}

Also available in: Unified diff