I’m considering switching to an Arduino Mega due to concerns about memory when driving 300 Neopixels - does anybody know if the code below will have to change? I vaguely recall reading somewhere that the registers are different than the Uno.

My program currently uses 1500 bytes of dynamic memory, and I have not yet implemented the code for the FastLED library I am planning on using for the LED animations. Including the 900 bytes that are required the drive the LEDs, will the 4000bytes of dynamic memory from the Mega be sufficient?

Please excuse if any of this information is correct, my research is ongoing as I just became aware of this problem.

```
/*
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.
*/
// do #defines BEFORE #includes
#define LIN_OUT 1 // use the log output function
#define FFT_N 256 // set to 256 point fft
#define DC_OFFSET 511
#define SAMPLING_FREQ (16000000/(13*32))
#include <FFT.h> // include the library
int adc_val;
void setup() {
Serial.begin(9600); // use the serial port
TIMSK0 = 0; // turn off timer0 for lower jitter - delay() and millis() killed
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 -= DC_OFFSET;
adc_val = k<<6;
fft_input[i] = adc_val; // put real data into even bins
fft_input[i + 1] = 0; // set odd bins to 0
}
// window data, then reorder, then run, then take output
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_lin(); // take the output of the fft
sei(); // turn interrupts back on
Serial.println("start");
for (int j = 0 ; j < 128 ; j++) {
Serial.print("Frequency: "); Serial.print(j * (SAMPLING_FREQ / FFT_N)); Serial.print(" ");
Serial.println(fft_lin_out[j]); // print out the data
}
Serial.print("\n");
}
}
```