So i replaced the old functions with the new ones and i get these errors any ideas?
C:\Users\Mike\Documents\Arduino\libraries\FHT/FHT.h:72:10: error: 'prog_int16_t' does not name a type
PROGMEM prog_int16_t _cas_constants[] = {
^
In file included from C:\Users\Mike\Documents\Arduino\Test1\Test1.ino:5:0:
C:\Users\Mike\Documents\Arduino\libraries\FHT/FHT.h:87:12: error: 'prog_uint8_t' does not name a type
PROGMEM prog_uint8_t _reorder_table[] = {
^
In file included from C:\Users\Mike\Documents\Arduino\Test1\Test1.ino:5:0:
C:\Users\Mike\Documents\Arduino\libraries\FHT/FHT.h:113:12: error: 'prog_uint8_t' does not name a type
PROGMEM prog_uint8_t _lin_table[] = {
^
In file included from C:\Users\Mike\Documents\Arduino\Test1\Test1.ino:5:0:
C:\Users\Mike\Documents\Arduino\libraries\FHT/FHT.h:131:12: error: 'prog_int16_t' does not name a type
PROGMEM prog_int16_t _window_func[] = {
^
Here's my code
#define LIN_OUT 1
#define FHT_N 128 // set to 256 point fht
#include <FHT.h> // include the library
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#include <TimerOne.h>
#define CLK 8
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
byte sample[64];
unsigned long startTime, endTime, oldTime;
int displaySize=32;
void setup() {
ADCSRA = 0xe7; // set the adc to free running mode
ADMUX = 0x45; // use adc5
DIDR0 = 0x20; // turn off the digital input for adc5
}
void loop() {
startTime = millis();
sampleInput();
sampleFix();
drawSpectrum();
endTime = millis();
}
void drawSpectrum () {
matrix.fillScreen(matrix.Color333(0, 0, 0));
for (int disX; disX < 33; disX++) {
matrix.drawLine(disX, 16, disX, 16-sample[disX+1], matrix.Color333(7, 0, 0));
}
}
void sampleInput() {
cli(); // UDRE interrupt slows this way down on arduino1.0
for (int x=0; x<FHT_N; x++) {
while(!(ADCSRA & 0x10)); // wait for adc to be ready
ADCSRA = 0xf5; // restart adc
ADMUX = 0x45; // use adc5
byte m = ADCL; // fetch adc data
byte j = ADCH;
int k = (j << 8) | m; // form into an int
k -= 0x0200; // form into a signed int
k <<= 6; // form into a 16b signed int
fht_input[x] = k; // put real data into bins
}
sei();
fht_window(); // window the data for better frequency response
fht_reorder(); // reorder the data before doing the fht
fht_run(); // process the data in the fht
fht_mag_lin();
}
void sampleFix() {
int newPos;
float fhtCount, tempY;
for (int x=0; x < displaySize; x++) {
fhtCount = FHT_N/2;
newPos = x * (fhtCount / displaySize); // single channel half-display 15-LED wide
tempY = fht_lin_out[newPos];
sample[x] = ((tempY/256)*16);
}
}
i attach a timer library
Timer1.zip (6.09 KB)