Text in Processing

edited January 2017 in Arduino

Why the text inmy code doesn't work?

`

import processing.serial.*;

//Serial port
Serial port;

//Value read from serial
float val;

//value to create x and y axes
int x = 150;
int y = 600;

//value to write intervals x and y axes
int x1;
int y1;

void setup()
{
  size(1000, 700);
  background(255);
  //name of the usb port
  String portname = Serial.list()[0];

  //object port
  port = new Serial(this, portname, 9600);

  //Increase in 2 the thickness
  strokeWeight(2);

  //x axis
  line(100, 650, 900, 650);

  //y axis
  line(100, 650, 100, 50);

  //intervals x axis
  for(int i = 0; i < 16;i++)
  {

    line(x, 640, x, 660);
    x = x + 50;

  }  

  //intervals y axis
  for(int i = 0;i < 12; i++)
  {

    line(90, y, 110, y);
    y = y - 50;

  }

  //values x axis
  text("1", 147, 675);
  for(int i = 0;i < 17;i++)
  {



  }  

}

void draw()
{

  //If port is available
  if(port.available() > 0)
  {
    String string = port.readString();
    val = float(string);
    println(val);
  }  

}

`

Answers

This discussion has been closed.