IvanS297_-/listing_11_6___7_reading_data_from_sensor__reading_data_in_port/listing_11_6___7_reading_data_from_sensor__reading_data_in_port.pde
import processing.serial.*;

Serial port;
float val;

void setup()
{
  size(440, 220);
  println(Serial.list());
  port = new Serial(this, "COM31", 9600);
}

void draw()
{
  if (port.available() > 0)
  {
    val = port.read();
    val = map(val, 0, 255, 0, height);
  }
  rect(40, val-10, 360, 20);
}
