2013-08-21 34 views
0

我一直在LED牆上工作,並出現了RAM問題。基本上我使用teensy 3.0並嘗試加載以下腳本,但是,.bss腳本錯誤不適合區域'RAM' 請幫助!任何信息將不勝感激!謝謝!.bss將不適合區域ram

/* 
Nike NFL draft LED wall program 

OctoWS2811 BasicTest.ino - Basic RGB LED Test 
http://www.pjrc.com/teensy/td_libs_OctoWS2811.html 
Copyright (c) 2013 Paul Stoffregen, PJRC.COM, LLC 

*/ 

#include <OctoWS2811.h> 

const int ledsPerStrip = 290; 

DMAMEM int displayMemory[ledsPerStrip*6]; 
int drawingMemory[ledsPerStrip*6]; 

const int config = WS2811_GRB | WS2811_800kHz; 

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config); 

#define ORANGE 0xE05800 
#define WHITE 0xFFFFFF 
#define BLACK 0x000000 
#define BLACK2 0x1E1E1E 

void setup() { 
    leds.begin(); 
    leds.show(); 
} 

static int widths[] = { 30, 30, 50, 90, 40, 60 }; 
static int speeds[] = { 5, 5, 10, 16, 11, 13 }; 
static int locations[] = { 0, 0, 0, 0, 0, 0 }; 
static int counter = 0; 
//static int location = 0; 
static boolean reverse = false; 

int blend(int source  , float alpha) { 
    int source_r = (source >> 16); 
    int source_g = ((source >> 8) & 0x00FF); 
    int source_b = (source & 0x0000FF); 

    source_r = source_r * alpha; 
    source_g = source_g * alpha; 
    source_b = source_b * alpha; 

    return source_b | (source_g << 8) | (source_r << 16); 
} 

void loop() { 
    int microsec = 2000000/leds.numPixels(); // change them all in 2 seconds 

    int location; 
    int offset; 
    int width; 
    int current; 
    int min; 
    int color; 
    float alpha = 0.95; // Set brightness of head 
    int head_width = 3; // Set width of head 

    delay(20); 

    int i; 
    for(i = 0; i < 6; ++i) { 
    location = locations[i]; 
    width = widths[i]; 
    color = 0xFFFFFF; 
    offset = i*ledsPerStrip; 

    location = location + speeds[i]; 

    if(location > ledsPerStrip + width) { 
     location = 0; 
    } 

    locations[i] = location; 

    if(location < width) { 
     current = location; 
     min = 0; 
    } else if(location >= width) { 
     current = location; 
     min = location - width + 1; 
    } 

    for(current; current >= 0; --current) { 
     if(current >= min) { 
     if(current < ledsPerStrip) { 
      if(!reverse) { 
      leds.setPixel(current + offset, color); 
      } else { 
      leds.setPixel((ledsPerStrip - current) + offset, color); 
      } 
     } 
     if(current < (location - head_width)) { 
      color = blend(color, alpha); 
     } 
     } else { 
     if(!reverse) { 
      leds.setPixel(current + offset, BLACK); 
     } else { 
      leds.setPixel((ledsPerStrip - current) + offset, BLACK); 
     } 
     } 
    } 
    } 

    leds.show(); 

    counter++; 
} 

而返回錯誤: 該報告將在 文件>首選項啓用「編譯過程中顯示詳細輸出」與 更多的信息。Arduino:1.0.5(Windows 7),Board:「Teensy 3.0」 c:/ program files/arduino/hardware/tools/arm-none-eabi/bin /../ lib/gcc/arm-none-eabi /4.7.2/../../../../arm-none-eabi/bin/ld.exe:Nike_NFL_Program.cpp.elf部分.bss' will not fit in region RAM' c:/ program files/arduino/hardware/tools /arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe:區域「RAM」溢出1028字節 collect2.exe:錯誤:ld返回1退出狀態

謝謝!

回答

0

您的內存不足。將其從6個編譯爲5個編譯。請注意,3.0有16384個SRAM。每個倍數都會消耗大量有限的16384 SRAM。