2015-12-22 67 views
0

我正在使用500個可完全尋址的LED指示燈來控制Arduino控制的聖誕樹。我正在使用FastLED庫,目前(儘管我將更新一些動畫以通過採樣音頻進行控制),我使用http://pastebin.com/Qe0Jttme的代碼作爲起點。Arduino FastLED由於折舊導致的編譯錯誤

以下行:(線#36引擎收錄的例子)

const PROGMEM prog_uint16_t levels[NUM_LEVELS] = {58, 108, 149, 187, 224, 264, 292, 309, 321, 327, 336, 348}; 

是給我的錯誤:

exit status 1 
'prog_uint16_t' does not name a type 

這是因爲它已經貶值了。我發現了一個替代here,但現在由於折舊導致以下線路錯誤,但我不知道如何克服它。

const PROGMEM prog_uchar ledCharSet[20] = { 
B00111111,B00000110,B01011011,B01001111,B01100110,B01101101,B01111101,B00000111,B01111111,B01101111, 
B10111111,B10000110,B11011011,B11001111,B11100110,B11101101,B11111101,B10000111,B11111111,B11101111 
}; 

返回相同的錯誤:

exit status 1 
'prog_uchar' does not name a type 

我使用Arduino的版本1.6.6和最新FastLED庫。

回答

1

如果有很多這些prog_類型的那麼簡單的解決辦法是建立在它下面,幷包括在使用這些類型的任何文件頭文件:如果只有

#include <stdint.h> 

typedef void prog_void; 
typedef char prog_char; 
typedef unsigned char prog_uchar; 
typedef int8_t prog_int8_t; 
typedef uint8_t prog_uint8_t; 
typedef int16_t prog_int16_t; 
typedef uint16_t prog_uint16_t; 
typedef int32_t prog_int32_t; 
typedef uint32_t prog_uint32_t; 
typedef int64_t prog_int64_t; 
typedef uint64_t prog_uint64_t; 

prog_類型的一些用法,或者如果您想要正確地修復代碼,那麼只需將它們替換爲使用的類型即可。例如:

const PROGMEM uint16_t levels[NUM_LEVELS] = {...}; 
const PROGMEM unsigned char ledCharSet[20] = {...};