Closed skotchvail closed 11 years ago
Trying to get this done today, using CSV files
Hey, I've been unpacking/working at the warehouse all week and broke yet another promise to get to this. For what it's worth, here's the code I had written on this to date:
void mapAllLeds() {
// read array of values from our spreadsheet
String[] lines = loadStrings("data/pixels.csv");
// the first line is the column headers, so skip it
for(int i = 1; i < lines.length; i++){
int[] tokens = int(split(lines[i], ','));
int numElements = tokens.length;
// println("Line " + i + " has " + numElements + " elements.");
// if this doesn't have at least 7 elements, it's probably a comment, so continue
if(numElements < 7) {
continue;
}
// set LED value
ledSetNew(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[6]);
}
}
```java
void ledSetNew(int whichStrand, int xOffsetter, int yOffsetter, int ordinalOffsetter, int ordinal, int x, int y) {
biggestX = max(x + xOffsetter, biggestX);
biggestY = max(y + yOffsetter, biggestY);
ledSetValue(whichStrand, ordinal + ordinalOffsetter, c2i(x + xOffsetter, y + yOffsetter));
}
Now that I'm here and somewhat settled in let's Skype soon and talk about getting me back into this work, budgeting some time for that and making some schedules.
We can now read and write from CSV files.
Currently the location of the LED's is set in code. Instead, it should be read from disk in files that can change. Use some human readable / modifiable format like XML. The program will also need to be able to write out this format. It should be based on the existing code format that we have worked out, at least as a starting point.
We will also want to have these data files checked into Git, even though they are modifiable in real time.