Project

General

Profile

Revision 1220

View differences:

main.c
95 95
// ** Receive callbacks **
96 96
// ***********************
97 97

  
98
// TODO: different group for commands and requests
99 98
static void station_robot_receive (char type, int source, unsigned char* packet, int length)
100 99
{
101
	// TODO why does it keep receiving 0 messages?
102
	//if (type==0) return;
103

  
104 100
	orb_set (0, 0, 255);
105 101

  
106
	usb_puts ("Received a message: ");
107 102
	usb_puti (type);
108
	usb_puts ("\r\n");
103
	usb_puts (" [");
104
	for (uint8_t i=0; i<length; ++i)
105
	{
106
		if (i!=0) usb_putc (' ');
107
		usb_puti (packet[i]);
108
	}
109
	usb_puts ("]\r\n");
109 110
	
110 111
	switch (type)
111 112
	{
......
129 130
// **********
130 131

  
131 132
int main(void) {
132
    dragonfly_init(ALL_ON); // TODO initialize only required components
133
    dragonfly_init(ALL_ON);
133 134

  
134
	encoders_init ();
135

  
136 135
    usb_init ();
137 136
    usb_puts ("Diagnostic station robot starting up\r\n");
138 137

  
139
    orb_init_pwm ();
138
	orb1_set (255, 127, 0);
140 139
	xbee_init ();
141
	
142
	orb1_set (255, 127, 0);
143 140
	wl_init();
144 141
	orb2_set (255, 127, 0);
145 142
	

Also available in: Unified diff