# Serial plotter over bluetooth

**URL:** <https://discourse.processing.org/t/serial-plotter-over-bluetooth/22378>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [July 4, 2020, 2:12pm UTC](https://discourse.processing.org/t/serial-plotter-over-bluetooth/22378 "2020-07-04T14:12:02Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 8, 2020, 2:16pm UTC](https://discourse.processing.org/t/serial-plotter-over-bluetooth/22378/18 "2020-07-08T14:16:12Z")

</div>

> [@alexthesmeus](#):
>
> It’s enough but I’d like to have the old line not cleared all at once time but disappearing once the new line is approching it. How could I manage it?

Examples of fading:

> **[Moving On Curves / Examples](https://processing.org/examples/movingoncurves.html)**
>
> In this example, the circles moves along the curve y = x^4. Click the mouse to have it move to a new position.

> **[Simple Particle System / Examples](https://processing.org/examples/simpleparticlesystem.html)**
>
> Particles are generated each cycle through draw(), fall with gravity and fade out over time. A ParticleSystem object manages a variable size (ArrayList) list of particles.

There may be others…

Slimmed down (to just a line) version of fading I use:

```auto
int i;
int alpha;

public void setup() 
  {
  size(512, 200);   
  background(0);
  }

public void draw() 
  {   
  background(0);
  
  i = 300; 
   
  for(int j = 0; j<i; j++)
    {
    alpha = 0;
    if (j > i - 255)
    alpha = 255 - (i - j); // tail fades away 
      
    stroke(0, 255, 0, alpha);
    strokeWeight(10);
    point(j, height/2); 
    }  
  }

```

I used the above for my scrolling ECG plot:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/307f60a590e490ee3624589b90101b8821746ba7.png)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/serial-plotter-over-bluetooth/22378)._
