lightscapes.
Light mapped through time (greyscale/colour).
 
arduino processing light print marta fuster barutell
06.06.2017: 08:41:17 to 09:12:37


31.05.2017: 11:02:53 to 11:42:23




09.06.2017: 14:53:22 to 16:12:01




10.06.2017: 09:11:38 to 10:02:23 (150,150,luxMap)




01.06.2017: 08:49:21 to 11:04:36 (150,150,luxMap)

Processing code:

Table table;
int margin;
TableRow row;
String dateRow;
String timeRowStart;
String timeRowEnd;
int RowCount;

void setup () {
size(800, 1600);
margin = 50;
processData();
}

void draw () {
background(255);
fill(0);
RowCount = table.getRowCount();
dateRow = table.getString(0, 0);
timeRowStart = table.getString(1, 1);
timeRowEnd = table.getString(RowCount-1, 1);

text(dateRow +": "+ timeRowStart+ " to " + timeRowEnd, 50, 40);

int x=0;
int y=0;
for ( TableRow row : table.rows()) {
stroke(255);
fill(row.getFloat("luxMap"));
rect(margin+x*10, margin+y*10, 10, 10);
x++;
if (x>60) {
x=0;
y++;
}
}
}

void processData() {
// load data
table = loadTable("date-time-lux-example.csv", "header"); //load file
dateRow = table.getString(0, 0);

// find lux min and max
float[] luxValues = table.getFloatColumn("lux");
float luxMin = min(luxValues)-100;
float luxMax = max(luxValues)+10;

// add a luxMap column to the table and calculate it
table.addColumn("luxMap", Table.FLOAT);
for ( TableRow row : table.rows()) {
row.setFloat("luxMap", map(row.getInt("lux"), luxMin, luxMax, 0, 255));
}
}