#### Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

# How to create a Heap Map

edited September 2017 in Arduino

Hi All,

I'm very new to Processing and would greatly appreciate any help.

I am trying to create a heat map of pressure applied to feet.

I am able to read sensor data and display it on Processing. However, my aim is to create a heat map on an ellipse the colours ranging from Blue (Low Pressure) -Cyan-Green-Yellow-Red (High Pressure). I can create individual colours, but is it possible apply colours in between each individual colour?

• edited September 2017

I have got slightly further with my code.

The issue I am facing now is that, once a colour is displayed it doesn't seem to disappear even if the rule isn't met.

Code Below:

``````if (c1 <= 204.6)
{
fill(0,0,255);
ellipse(200,204,5,5);
}

else if ((c1 >= 204.6) && (c1 <= 204.6*2))
{

color from = color(0, 0, 255); // start from blue
color to = color(0, c1*1.25-255, 255); // finish at cyan
color interA = lerpColor(from, to, sensor1);
fill(interA);
ellipse(200,204,+0.1,+0.1);

}

else if ((c1 >= 204.6*2) && (c1 <= 204.6*3))
{
color from = color(0, c1*1.25-255, 255); //starts from Cyan
color to = color(0, 255, c1*1.25-255*2); //Finish at Green
color interA = lerpColor(from, to, sensor1);
fill(interA);
ellipse(200,204,+0.1,+0.1);
}

else if ((c1 >= 204.6*3) && (c1 <= 204.6*4))
{
color from = color(0, 255, c1*1.25-255*2); //starts from Green
color to = color(c1*1.25-255*3, 255, 0); //Finish at Yellow
color interA = lerpColor(from, to, sensor1);
fill(interA);
ellipse(200,204,20,20);
}

else if ((c1 >= 204.6*4) && (c1 <= 204.6*5))
{
color from = color(0, 255, c1*1.25-255*2); //starts from Yellow
color to = color(c1*1.25-255*4, 0, 0); //Finish at Red
color interA = lerpColor(from, to, sensor1);
fill(interA);
ellipse(200,204,30,30);
}
}
``````

I would like the colour to disappear once the value in "c1" is reduced. c1 has a value from 0 - 1023.