I want to create a line graph for the results generated by the Wii Nunchuck (I'm using it as an accelerometer). At this moment it's a bar graph. I would like to show the time & the moment in my line graph, to get a view on the sleeping pattern of a child. Here's is the code I'm using at this moment in Processing. Could anyone help me out here?
//This example reads in a single byte value from 0 to 255 and graphs it.
///////////////////////////////////////// //Basic serial communication code //by Chang Soo Lee //ITP, NYU //Created 11/27/2005 /////////////////////////////////////////
import processing.serial.*; Serial myPort; int serial = 1; PFont font; int numH = 370;
void setup () { size(270, 440); println(Serial.list()); myPort = new Serial(this, Serial.list()[0], 19200); // Load the font. Fonts must be placed within the data // directory of your sketch. Use Tools > Create Font // to create a distributable bitmap font. // For vector fonts, use the createFont() function.
font = loadFont("HelveticaNeueLTCom-Md-48.vlw"); smooth(); }
void draw () { background(255);
if (myPort.available() > 0) { serial = myPort.read(); serialEvent(); }