#include <asf.h>
#include "NeoPixel.h"
#include "WiFi.h"
#include "string_func.h"

uint8_t buffer[24 * 3 * 3 + 90];

int main (void)
{
	/* initialize clock system (conf_clocks.h) */
	system_init();
	delay_init();
	
	/* initialize NeoPixel strip */
	NeoPixel_init();
	
	/* initialize WiFi */
	WiFi_init();
	
	/* set default animation */
	NeoPixel_set_animation(KITT);
	
	char data[100];
	
	while(1)
	{
		/* update animation */
		NeoPixel_update_animation();
		
		/* do other things */
		if (WiFi_receive_data(data, sizeof data))
		{
			if (strcomp(data, "BREATHING") == 0)
				NeoPixel_set_animation(BREATHING);
			else if (strcomp(data, "KITT") == 0)
				NeoPixel_set_animation(KITT);
			else if (strcomp(data, "BLINK") == 0)
				NeoPixel_set_animation(BLINK);
			else if (strcomp(data, "SOUND") == 0)
				NeoPixel_set_animation(SOUND);
		}
	}
}


