Hello, newbie here,
Today I would like to ask you: what arduino IDE platform should I use for this code?
I was trying to use all from 1.0.x to 1.6.x but different platform, diferrent error, which I can't even understand:
#define LOG_OUT 1 // use the log output function
#define FHT_N 256 // set to 256 point fht
#include <FHT.h>
#include "MD_MAX72XX.h"
int bins = FHT_N / 2;
#define CS_PIN 6 //SS
#define NUM_DEV 2
MD_MAX72XX led = MD_MAX72XX(CS_PIN, NUM_DEV); //use SPI hardware
byte cols[] = {
0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF};
void setup() {
TIMSK0 = 0; // turn off timer0 for lower jitter
ADCSRA = 0xe5; // set the adc to free running mode, div 32 prescaler
ADMUX = 0x40; // use adc0 w/ 1.1V ref
DIDR0 = 0x01; // turn off the digital input for adc0
led.begin();
}
void loop() {
while (1) { // reduces jitter
cli(); // UDRE interrupt slows this way down on arduino1.0
for (int i = 0 ; i < FHT_N ; i++) { // save 256 samples
while (!(ADCSRA & 0x10)); // wait for adc to be ready
ADCSRA = 0xf5; // restart adc
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[i] = k; // put real data into bins
}
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_log(); // magnitude response dB
sei();
//the display is written backwards, so bins-1-i
for (int i = 0; i < bins; i++) {
led.setColumn(i, cols[fht_log_out[bins - 1 - i] / 32]);
//mx.setColumn(i,cols[fht_log_out[bins-33-i]/32]); //offset 32
}
}
}
I 100% guaranted, that there is no proggraming mistakes, because code is made not by my self, but by smarter guys.
So could you place my code with all libraries in your Arduino IDE and say what solution should I reach?
Error message in 1.0 Arduino IDE:
Spectrum.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Users\Dzastis\AppData\Local\Temp\build3103482675569704779.tmp/Spectrum.cpp:14: undefined reference to `MD_MAX72XX::MD_MAX72XX(unsigned char, unsigned char)'
C:\Users\Dzastis\AppData\Local\Temp\build3103482675569704779.tmp/Spectrum.cpp:14: undefined reference to `MD_MAX72XX::~MD_MAX72XX()'
Spectrum.cpp.o: In function `MD_MAX72XX::setColumn(unsigned char, unsigned char)':
/MD_MAX72XX.h:606: undefined reference to `MD_MAX72XX::setColumn(unsigned char, unsigned char, unsigned char)'
Spectrum.cpp.o: In function `setup':
C:\Users\Dzastis\AppData\Local\Temp\build3103482675569704779.tmp/Spectrum.cpp:24: undefined reference to `MD_MAX72XX::begin()'
Error message in 1.6.9 Arduino IDE:
Arduino: 1.6.9 (Windows 8.1), Board: "Arduino/Genuino Uno"
sketch\Font Builder\src\font2txt\font2txt.c:15:22: fatal error: txt2font.h: No such file or directory
#include "txt2font.h"
^
compilation terminated.
Multiple libraries were found for "FHT.h"
Used: C:\Users\Dzastis\Documents\Arduino\libraries\FHT
Not used: C:\Program Files\Arduino\libraries\FHT
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Thank you for your help
P.S. Code with all libraries included: http://tinyurl.com/gqqfkuu