fixed internal clock to 16Mhz

This commit is contained in:
Jonathan Wyss 2024-02-27 21:29:54 +01:00
parent 1c64b41a4d
commit 7dba052e88
3 changed files with 18 additions and 10 deletions

View File

@ -31,7 +31,7 @@ int fix_fft(char fr[], char fi[], int m, int inverse);
real and imaginary samples in the complex array. real and imaginary samples in the complex array.
*/ */
int fix_fftr(char f[], int m, int inverse); int fix_fftr(char f[], int m, int inverse);
static inline char FIX_MPY(char a,char b); //static inline char FIX_MPY(char a,char b);

24
main.c
View File

@ -1,4 +1,4 @@
#define F_CPU 1000000UL #define F_CPU 16000000UL
#include<util/delay.h> #include<util/delay.h>
#include<avr/io.h> #include<avr/io.h>
@ -16,9 +16,18 @@ int main (void)
int i; int i;
char sample[128]; char sample[128];
char im[128]; char im[128];
struct cRGB led_bar1[1]; struct cRGB led_bar1[8];
//DDRB = (1<<mic);//would be setting output, default is input so no need for setting //DDRB = (1<<mic);//would be setting output, default is input so no need for setting
//setupADC(); //setupADC();
for(i=0;i<8;i++)
{
led_bar1[i].r=10;
led_bar1[i].g=10;
led_bar1[i].b=10;
}
while(1) while(1)
{ {
@ -30,11 +39,10 @@ int main (void)
}*/ }*/
//fix_fft(sample,im,7,0);//im[i] is always zero //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; led_bar1[0].r=0;led_bar1[0].g=100;led_bar1[0].b=10;
ws2812_setleds(led_bar1,1); ws2812_sendarray((uint8_t *)led_bar1,8*3);
_delay_ms(500);
_delay_ms(500); led_bar1[0].r=255;led_bar1[0].g=0;led_bar1[0].b=10;
led_bar1[0].r=255;led_bar1[0].g=0;led_bar1[0].b=10; ws2812_sendarray((uint8_t *)led_bar1,8*3);
ws2812_setleds(led_bar1,1);
_delay_ms(500); _delay_ms(500);
} }

View File

@ -28,7 +28,7 @@ DEBUG = stabs
CSTANDARD = -std=gnu99 CSTANDARD = -std=gnu99
# Place -D or -U options here # Place -D or -U options here
CDEFS = -DF_CPU=1000000UL CDEFS = -DF_CPU=16000000UL
# Place -I options here # Place -I options here
CINCS = CINCS =