171
edits
Diannamertz (talk | contribs) mNo edit summary |
Diannamertz (talk | contribs) mNo edit summary |
||
Line 38: | Line 38: | ||
import processing.serial.*; | import processing.serial.*; | ||
int incomingVal; | int incomingVal; | ||
int level; | |||
int r; | int r; | ||
int b; | int b; | ||
Line 46: | Line 47: | ||
size(255,255); | size(255,255); | ||
dataTable = new Table("data.tsv"); | dataTable = new Table("data.tsv"); | ||
//rowCount = dataTable.getRowCount(); | |||
myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | myPort = new Serial(this,"/dev/tty.usbmodem411",9600); | ||
} | } | ||
Line 54: | Line 56: | ||
incomingVal = myPort.read(); | incomingVal = myPort.read(); | ||
} | } | ||
fill( | level = height - incomingVal; | ||
rect(0, | fill(level); | ||
rect(0,level,width,height); | |||
PrintWriter output = createWriter("data/data.tsv"); | PrintWriter output = createWriter("data/data.tsv"); | ||
output.println("Pasta:" + | output.println("Pasta:" +level+ " Rice:" +r+ " Bulgar:" +b+ " Quinoa:" +q+ " Oats:" +o ); | ||
output.flush(); | output.flush(); | ||
} | } | ||
</source> | </source> |
edits