I tried to upload a sketch I have used many times recently and it keeps giving me errors. I used it to create this. I used the following libraries and that seems to be where the errors are coming from. I get the following errors. I do not understand why it is giving me errors. It used to work. What has changed?
Here are my errors.
C:\Users\Hawkins\Documents\Arduino\libraries\BeatSync\fix_fft.cpp:50: error: expected initializer before 'Sinewave'
C:\Users\Hawkins\Documents\Arduino\libraries\BeatSync\fix_fft.cpp: In function 'int fix_fft(char*, char*, int, int)':
C:\Users\Hawkins\Documents\Arduino\libraries\BeatSync\fix_fft.cpp:199: error: 'Sinewave' was not declared in this scope
C:\Users\Hawkins\Documents\Arduino\libraries\BeatSync\fix_fft.cpp:209: error: 'Sinewave' was not declared in this scope
//
// Beat Sync
// A music visualization device.
// Created by
// Carl Smith
// penguinmagic@hotmail.com
//
#include <fix_fft.h>
int led[] = {5,6,7,8,9,10,11,12};
int x = 0;
char im[128], data[128];
char data_avgs[14];
int i=0,val;
#define AUDIOPIN 3
void setup()
{
for (int i = 0; i <8; i++)
{
pinMode(led[i], OUTPUT);
}
Serial.begin(9600);
}
void loop()
{
for (i=0; i < 128; i++){
val = analogRead(AUDIOPIN);
data[i] = val;
im[i] = 0;
};
fix_fft(data,im,7,0);
for (i=0; i< 64;i++){
data[i] = sqrt(data[i] * data[i] + im[i] * im[i]); // this gets the absolute value of the values in the
//array, so we're only dealing with positive numbers
};
// average bars together
for (i=0; i<14; i++) {
data_avgs[i] = data[i*4] + data[i*4 + 1] + data[i*4 + 2] + data[i*4 + 3]; // average together
data_avgs[i] = map(data_avgs[i], 0, 30, 0, 9); // remap values for LoL
}
int value = data_avgs[0];//0 for bass
ledArray(value);
}
void ledArray(int input)
{
//
if (input > 8)
{
for (int i = 0; i <8; i++)
{
digitalWrite(led[i], HIGH);
}
}
else if (input > 7)
{
for (int i = 0; i <7; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 7; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 6)
{
for (int i = 0; i <6; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 6; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 5)
{
for (int i = 0; i <5; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 5; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 4)
{
for (int i = 0; i <4; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 4; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 3)
{
for (int i = 0; i <3; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 3; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 2)
{
for (int i = 0; i <2; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 2; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else if (input > 1)
{
for (int i = 0; i <1; i++)
{
digitalWrite(led[i], HIGH);
}
for (int i = 1; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
else
{
for (int i = 0; i <8; i++)
{
digitalWrite(led[i], LOW);
}
}
}