Добрый день! Пытаюсь запустить пример с библиотеки FFT.h- получаю ошибку: error: 'prog_uint8_t' does not name a type Подскажите, пожалуйста, как исправить! Ссылка на библиотеку: http://wiki.openmusiclabs.com/wiki/ArduinoFFT Спасибо! Пример: Код (C++): /* fft_adc.pde guest openmusiclabs.com 8.18.12 example sketch for testing the fft library. it takes in data on ADC0 (Analog0) and processes them with the fft. the data is sent out over the serial port at 115.2kb. there is a pure data patch for visualizing the data. */ #define LOG_OUT 1 // use the log output function #define FFT_N 256 // set to 256 point fft #include <FFT.h> // include the library void setup() { Serial.begin(115200); // use the serial port TIMSK0 = 0; // turn off timer0 for lower jitter ADCSRA = 0xe5; // set the adc to free running mode ADMUX = 0x40; // use adc0 DIDR0 = 0x01; // turn off the digital input for adc0 } void loop() { while(1) { // reduces jitter cli(); // UDRE interrupt slows this way down on arduino1.0 for (int i = 0 ; i < 512 ; i += 2) { // 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 fft_input[i] = k; // put real data into even bins fft_input[i+1] = 0; // set odd bins to 0 } fft_window(); // window the data for better frequency response fft_reorder(); // reorder the data before doing the fft fft_run(); // process the data in the fft fft_mag_log(); // take the output of the fft sei(); Serial.write(255); // send a start byte Serial.write(fft_log_out, 128); // send out the data } }
Arduino 1.6.9, Arduino FFT library (v2) http://wiki.openmusiclabs.com/wiki/ArduinoFFT?action=AttachFile&do=view&target=ArduinoFFT2.zip, в файле FFT.h в асм вставках перед строковым литералом STRINGIFY добавил пробел (иначе выдавал предупреждения - warning: invalid suffix on literal; C++11 requires a space between literal and identifier, измененный файл во вложении) - компиляция прошла упешно. Arduino 1.6.11 с новой версией GCC выдает ошибки сборщика - Код (C++): `_window_func' referenced in section `.text.startup' of C:\Users\User\AppData\Local\Temp\ccr0snJN.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\fft_adc.pde.cpp.o (symbol from plugin) `_window_func' referenced in section `.text.startup' of C:\Users\User\AppData\Local\Temp\ccr0snJN.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\fft_adc.pde.cpp.o (symbol from plugin)
Спасибо за ответ, но мне это не помогло. Я пробовал версии 6.10 6.11 7.10 и везде одна и та же ошибка:
1.6.11 не компилируется. А Вы не подскажете- я начинал с какой-то более старой версией и потом установил 1.6.10. После этого стало нужно предекларировать функции. что очень бесит. В 1.6.11 то же самое. Это можно как-то исправить?
У меня собралась в Arduino 1.6.9 http://arduino.cc/download_handler.php?f=/arduino-1.6.9-windows.zip Эта версия не требует установки, у меня распакована в E:\Portable\arduino-1.6.9