# Graph in processing

**URL:** https://discourse.processing.org/t/graph-in-processing/5255
**Category:** Electronics (Arduino, etc.)
**Tags:** homework
**Created:** [November 6, 2018, 2:05pm UTC](https://discourse.processing.org/t/graph-in-processing/5255 "2018-11-06T14:05:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![martijnroks](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@martijnroks](https://discourse.processing.org/u/martijnroks)
#### Post date: [November 6, 2018, 2:05pm UTC](https://discourse.processing.org/t/graph-in-processing/5255/1 "2018-11-06T14:05:15Z")

</div>

Hello,

I need to make a graph with GPS information embedded into it.  
I need to have the let and long in the graph. We get the information from the arduino with the sensor GP20U7.

The graph needs to show a realtime location. We have to long and let from the building, but I’m very new to processing and I don’t know how to build a graph.

I also don’t how to embed the information that the sensor sends to the arduino into the graph in processing.

The code I allready have is this:

```auto
import processing.serial.*;

Serial myPort; // maakt een object van seriele poort
String val; //ontvangt de data van de seriele poort

void setup() { 
  background(255);
 
  size (800,600); // maak het canvas
   
  String portName = Serial.list() [0]; // de 0 moet worden veranderd in de poort
  myPort= new Serial(this, portName, 9600);
 
 
  fill(0); 
  textSize(40); 
  text("GPS Tracker", 250, 75); 
  fill(250,0,0); 

 
  int y = 125; //stand y-as
  int x=75; // stand x-as
  int space = 25; // grote hokjes
  int len1 = 400; // aantal hokjes
  int stopX = 750;
  int len2 = stopX-x; 
  int stopY = y+len1;
 
  //Horizontal lines
  for (int xx=75; xx<=stopX; xx+=space) { 
    line(xx, y, xx, y+len1);
  }
 
  //Vertical lines  
  for (int yy=125; yy<=stopY; yy+=space) { 
    line(x, yy, x+len2, yy);
  }
}

void draw()
{
    if (myPort.available() > 0) //als data beschikbaar is
  {
    val = myPort.readStringUntil('\n'); // lees het uit en sla het op in val
    
   if (val != null) // Als er waardes worden uitgelezen gaat de hier in
   {
     println(val); // print het uit op het console
   }
    
  }
  fill(0,0,0); 
  ellipse(400,400, 25, 25); // circel getekend
}

```

I hope some one can help me!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [March 29, 2020, 8:28pm UTC](https://discourse.processing.org/t/graph-in-processing/5255/2 "2020-03-29T20:28:32Z")

</div>

It’s long and lat (not let)

there’s a library for geo things like this

here is also a tutorial and a download to be found:

see [Prevent Unfolding Map from panning off screen](https://discourse.processing.org/t/prevent-unfolding-map-from-panning-off-screen/18328/3)

(one year old…?)
