imbuedhope / LEDCubed

0 stars 1 forks source link

Moving forward on the Arduino, Quinn and Sriram please read #5

Open Collin9383 opened 10 years ago

Collin9383 commented 10 years ago

So Pujan and I spent a long time discussion the project and how we are going to implement the Arduino. There are basically two options. Option 1 we dont like, but it is to have the java program push things onto the serial buffer. And it would be a codeword which the ardiuno would read then output to the LED cube. Option 2 is to make the animations static and store them to an SD card, which can be read directly by the Arduino Ethernet ( it has a micro-SD card reader). The reason we like this is because it allows the Arduino to operate standalone, which would be better if we someday wanted to put this in a display or something. So basically it works like this. So there is a folder in the SD card, call it Animation_1 or something. In this is contains a large amount of sequentially numbered txt files. 0.txt 1.txt 2.txt.... etc. Each text file is one individual "frame" or one image. The exception is 0.txt which is an info file for the arduino about the animation. Number of frames, frame rate, and whether to repeat the animation are included in 0.txt And Example of the contents of a frame are as follows ( each letter would be a number) xx yy zz rrr ggg bbb # layout pattern *(note it is more designed for a 32x32x32 cube) 03 05 04 255 255 000 # some examples 07 04 03 150 075 120 02 01 00 022 255 012 ..... ..... ..... 99 99 99 000 000 000 # this is the end line, tells Arduino to begin top of file again.

So the Arduino will calculate how long to render each frame, will repeat rendering the frame from that file, then when the time has elapsed, will move on to the next file. It knows how many files there are, and when it gets to the end it will either begin again or halt.

So we are going to actually turn this into code soon, it shouldnt take too long since you already wrote the output function which we need to just supply with the variable values.

So with this in mind, we were hoping that you could make the java then create these txt files for us to read, given that you can plug in equations and writing them by hand would be a huge pain.

Let us know what you guys think

imbuedhope commented 10 years ago

I like the idea.

I still want a few commands sent over the Serial connection to help keep control of the system. I've updated Issue #2 with the new ones. This will help with debugging any remote issues and solving any problems, etc. You can set up a default sequence when there is no instruction from a comp.

If the Arduino will be managing the animations then there are some other things that it will have to account for. In each folder there will be a conf.txt that will contain a few specifications on how to animate: TimeFlow=backtrack (or) TimeFlow=loop, NumFrames=000000, and more if the need arises.

Collin9383 commented 10 years ago

What do you mean by TimeFlow=backtrack or loop does that mean animate backwards after you reach the beginning? But yeah the 0.txt or conft.txt or whatever we call it it is the info file for things like this

imbuedhope commented 10 years ago

Yeah backtrack meaning goes from the end to the start again, loop starts from the first frame again. Are you OK with the changes to Issue #2 ?

Collin9383 commented 10 years ago

Yeah those all seem doable, will be helpful for interacting with the Arduino.

Collin9383 commented 10 years ago

So yeah we got the main bulk of the Arduino Code written, next step is going to be adding in commands for the serial monitor, as well as figuring out a way to change which animation we are running. But yeah, next step is adding Debug console stuff as well as interrupts to shut off the animation, or change animation.

imbuedhope commented 10 years ago

Sounds good. I've been a bit busy w/ some other stuff but I should have the file generation done soon.