first init
This commit is contained in:
42
main.c
Normal file
42
main.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#define F_CPU 1000000UL
|
||||
|
||||
#include<util/delay.h>
|
||||
#include<avr/io.h>
|
||||
#include"fix_fft.h"
|
||||
#include"avr_adc.h"
|
||||
#include"light_ws2812_AVR/Light_WS2812/ws2812_config.h"
|
||||
#include"light_ws2812_AVR/Light_WS2812/light_ws2812.h"
|
||||
|
||||
|
||||
#define STARTADC ADCSRA |= _BS(ADSC)
|
||||
#define PB_mic PB0
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int i;
|
||||
char sample[128];
|
||||
char im[128];
|
||||
struct cRGB led_bar1[1];
|
||||
//DDRB = (1<<mic);//would be setting output, default is input so no need for setting
|
||||
//setupADC();
|
||||
|
||||
while(1)
|
||||
{
|
||||
//######RECORD SAMPLES#######
|
||||
/*for(i=0;i<128;i++)
|
||||
{
|
||||
sample[i] = ADCH; //read Analog value register 8bit
|
||||
im[i]=0; //pseudo data for funciton
|
||||
}*/
|
||||
//fix_fft(sample,im,7,0);//im[i] is always zero
|
||||
led_bar1[0].r=0;led_bar1[0].g=100;led_bar1[0].b=10;
|
||||
ws2812_setleds(led_bar1,1);
|
||||
|
||||
_delay_ms(500);
|
||||
led_bar1[0].r=255;led_bar1[0].g=0;led_bar1[0].b=10;
|
||||
ws2812_setleds(led_bar1,1);
|
||||
_delay_ms(500);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user