Import an array to arduino?
in
Integration and Hardware
•
1 year ago
Hi, I'm using this code
here from Anthony Mattox on visualizing sound with processing. I want to take it a step further and and write another code that uses the data collected from processing and download it to Arduino to make a Music-responsive LED arrangement.
Here's the code that i got from the site
import krister.Ess.*; FFT myfft; AudioInput myinput; int bufferSize=512; void setup() { size(532,400); frameRate(30); background(255); noStroke(); fill(0); Ess.start(this); myinput=new AudioInput(bufferSize); myfft=new FFT(bufferSize*2); myinput.start(); myfft.damp(.3); myfft.equalizer(true); myfft.limits(.005,.05); } void draw() { background(255); for (int i=0; i<bufferSize;i++) { rect(i+10,390,1,myfft.spectrum[i]*-400); } } public void audioInputData(AudioInput theInput) { myfft.getSpectrum(myinput); }
So basically this codes acts as a spectrum a
nalyzer by using the microphone as the input. I want to import
myfft.spectrum[i]
and use it in another program and download that new program into arduino. So is there like an import command that i need to write in my second program, or do I just need to put both files in the same sketch folder?
I know this is just a simple matter of importing an array, but unfortunately I didn't really pay much attention during my Java class,(which I deeply regret).
1