FSR pressure matrix

Hi all,
I have a project that I need to manufacture a chair that prevent pressure sores using fsr sensors
The seat will have 9 fsr sensors and the backrest will have 4 more sensors.
The sensors are connected to Arduino and the user is presented with a GUI using processing software.
We have a problem in the GUI.
The alert system will include two types of alert algorithms. The first is an alert whenever the pressure exceeds the determined pressure threshold, while the second is ​a permanent alert every two hours when the sensors don’t detect change in the pressure which indicates that the user stayed in the same position.
The equation for the threshold is:
Pthreshold = (24 / cbrt(1 + 3 * exp(x))) + 6.5; // Threshold calculation
The fsr GUI metrix should look like this:
image

I have an Arduino code and I need processing code.
int fsrPin1 = A0;
int fsrPin2 = A1;
int fsrPin3 = A2;
int fsrPin4 = A3;
int fsrPin5 = A4;
int fsrPin6 = A5;
int fsrReading1;
int fsrReading2;
int fsrReading3;
int fsrReading4;
int fsrReading5;
int fsrReading6;
int fsrVoltage1;
int fsrVoltage2;
int fsrVoltage3;
int fsrVoltage4;
int fsrVoltage5;
int fsrVoltage6;
unsigned long fsrResistance1;
unsigned long fsrResistance2;
unsigned long fsrResistance3;
unsigned long fsrResistance4;
unsigned long fsrResistance5;
unsigned long fsrResistance6;
unsigned long fsrConductance1;

unsigned long fsrConductance2;
unsigned long fsrConductance3;
unsigned long fsrConductance4;
unsigned long fsrConductance5;
unsigned long fsrConductance6;
long fsrForce1;
long fsrForce2;
long fsrForce3;
long fsrForce4;
long fsrForce5;
long fsrForce6;
float pressure1;
float pressure2;
float pressure3;
float pressure4;
float pressure5;
float pressure6;
float Pthreshold ;
int set = 0;
float t;
String data = “”;
unsigned long timer1;

void setup(void) {
Serial.begin(9600);
pinMode(fsrPin1, INPUT);
pinMode(fsrPin2, INPUT);
pinMode(fsrPin3, INPUT);
pinMode(fsrPin4, INPUT);
pinMode(fsrPin5, INPUT);
pinMode(fsrPin6, INPUT);

}
void loop(void) {

// Serial.println(“test”);
fsrReading1 = analogRead(fsrPin1);

fsrReading2 = analogRead (fsrPin2);
fsrReading3 = analogRead (fsrPin3);
fsrReading4 = analogRead (fsrPin4);
fsrReading5 = analogRead (fsrPin5);
fsrReading6 = analogRead (fsrPin6);

//Serial.println(fsrReading1);
fsrVoltage1 = map(fsrReading1, 0, 1023, 0, 5000);
/*fsrResistance1 = 5000 - fsrVoltage1; // fsrVoltage is in millivolts so 5V = 5000mV
fsrResistance1 = 10000; // 10K resistor
fsrResistance1 /= fsrVoltage1;
/

// V_resistor = Vcc * 10K /(10K + FSR_resistance
// FSR_resistance = Vcc*10K/(V_Resistor) - 10K
if (fsrVoltage1 > 0)
{
fsrResistance1 = 5000.0 * 10000 / (fsrVoltage1) - 10000;

fsrConductance1 = 1000000; // we measure in micromhos
fsrConductance1 /= fsrResistance1;
if (fsrConductance1 <= 1000) {
  fsrForce1 = fsrConductance1 / 80;
} else {
  fsrForce1 = fsrConductance1 - 1000;
  fsrForce1 /= 30;
}

}
else
{
fsrResistance1=0;
fsrConductance1 = 0;
fsrForce1 = 0;
}

Serial.println();
Serial.println("fsrVoltage1 = " + String(fsrVoltage1));
Serial.println("fsrResistance1 = " + String(fsrResistance1));
Serial.println("fsrConductance1 = " + String(fsrConductance1));
Serial.println("fsrForce1 = " + String(fsrForce1));
Serial.println();
delay(500);

fsrVoltage2 = map(fsrReading2, 0, 1023, 0, 5000);
fsrResistance2 = 5000 - fsrVoltage2; // fsrVoltage is in millivolts so 5V = 5000mV
fsrResistance2 *= 10000; // 10K resistor
fsrResistance2 /= fsrVoltage2;
fsrConductance2 = 1000000; // we measure in micromhos
fsrConductance2 /= fsrResistance2;
if (fsrConductance2 <= 1000) {
fsrForce2 = fsrConductance2 / 80;
} else {
fsrForce2 = fsrConductance2 - 1000;
fsrForce2 /= 30;

}
fsrVoltage3 = map(fsrReading3, 0, 1023, 0, 5000);
fsrResistance3 = 5000 - fsrVoltage3; // fsrVoltage is in millivolts so 5V = 5000mV
fsrResistance3 *= 10000; // 10K resistor
fsrResistance3 /= fsrVoltage3;
fsrConductance3 = 1000000; // we measure in micromhos
fsrConductance3 /= fsrResistance3;
if (fsrConductance3 <= 1000) {
fsrForce3 = fsrConductance3 / 80;
} else {
fsrForce3 = fsrConductance3 - 1000;
fsrForce3 /= 30;
}
fsrVoltage4 = map(fsrReading4, 0, 1023, 0, 5000);
fsrResistance4 = 5000 - fsrVoltage4; // fsrVoltage is in millivolts so 5V = 5000mV
fsrResistance4 *= 10000; // 10K resistor
fsrResistance4 /= fsrVoltage4;
fsrConductance4 = 1000000; // we measure in micromhos
fsrConductance4 /= fsrResistance4;
if (fsrConductance4 <= 1000) {
fsrForce4 = fsrConductance4 / 80;
} else {
fsrForce4 = fsrConductance4 - 1000;
fsrForce4 /= 30;
}
fsrVoltage5 = map(fsrReading5, 0, 1023, 0, 5000);
fsrResistance5 = 5000 - fsrVoltage5; // fsrVoltage is in millivolts so 5V = 5000mV

fsrResistance5 *= 10000; // 10K resistor
fsrResistance5 /= fsrVoltage5;
fsrConductance5 = 1000000; // we measure in micromhos
fsrConductance5 /= fsrResistance5;
if (fsrConductance5 <= 1000) {
fsrForce5 = fsrConductance5 / 80;
} else {
fsrForce5 = fsrConductance5 - 1000;
fsrForce5 /= 30;
}
fsrVoltage6 = map(fsrReading6, 0, 1023, 0, 5000);
fsrResistance6 = 5000 - fsrVoltage6; // fsrVoltage is in millivolts so 5V = 5000mV
fsrResistance6 *= 10000; // 10K resistor
fsrResistance6 /= fsrVoltage6;
fsrConductance6 = 1000000; // we measure in micromhos
fsrConductance6 /= fsrResistance6;
if (fsrConductance6 <= 1000) {
fsrForce6 = fsrConductance6 / 80;
} else {
fsrForce6 = fsrConductance6 - 1000;
fsrForce6 /= 30;
}
// Calculation pressure [kPa]
pressure1 = fsrForce1 * 1.9745;
pressure2 = fsrForce3 * 1.9745;
pressure3 = fsrForce4 * 1.9745;
pressure4 = fsrForce5 * 1.9745;
pressure5 = fsrForce6 * 1.9745;

if ((pressure1 > 0 || pressure2 > 0 || pressure3 > 0 || pressure4 > 0 || pressure5 > 0 || pressure6 > 0) && set == 0) {
set = 1;
timer1 = millis();
}
else {
set = 0;
timer1 = millis();
Pthreshold = 0;
}
long c = timer1 / 1000;
t = float (c) / 60; // Conversion to minutes
float x = (t - 74) / 4;
Pthreshold = (24 / cbrt(1 + 3 * exp(x))) + 6.5; // Threshold calculation

/data = String(pressure1) + “,” + String(pressure2) + “,” + String(pressure3) + “,” + String(pressure4) + “,” +
String(pressure5) + “,” + String(Pthreshold);
/

data = String(fsrReading1) + “,” + String(pressure2) + “,” + String(pressure3) + “,” + String(pressure4) + “,” +
String(pressure5) + “,” + String(Pthreshold);
Serial.println(data);
delay(1000);
}

pls help me! I need to submit this project ASAP.

Hi

This is how to connect Arduino with processing

Try to send at first one sensor value

Hi
I tried to write a processing code but it doesn’t show the colors according to the pressure. This the code:

import processing.serial.*;
Serial port;
String[] mysensors = {"", “”, “”, “”, “”, “”, “”, “”, “”, “”};
String data="";
int x = 420;
int y = 500;
int x1=950;
int y1=750;
float[] d = {0, 0, 0, 0, 0};
float[] T = {0, 0, 0, 0, 0};
int r1=0, g1=0, b1=102;
int r2=0, g2=0, b2=102;
int r3=0, g3=0, b3=102;
int r4=0, g4=0, b4=102;
int r5=0, g5=0, b5=102;
int r6=0, g6=0, b6=102;
int p=0;
int[] c={0, 0, 0, 0, 0};
void setup() {
size(950, 750);
port = new Serial (this, “COM3”, 9600);
port.write(0);
port.bufferUntil(’\n’);
}
void draw() {
background(0);
fill(0, 0, 102);

rect(0, 0, x1, 30);
stroke(0, 0, 102);
strokeWeight(4);
line(0, 95, x1, 95); //first horizontal line
line(0, 380, x1, 380); //first horizontal line
fill(102, 204, 255);
textSize(28);
text(“Mattress for mapping and optimizing pressure for bedridden patients”, 0, 80, -30);
textSize(32);
text(“Pressure Map”, 365, 430, -30);
noStroke();
text((“Pressure1 : “+mysensors[0]+” kPa”), 10, 150);
text((“Pressure2 : “+mysensors[1]+” kPa”), 380, 150);
text((“Pressure3 : “+mysensors[2]+” kPa”), 10, 210);
text((“Pressure4 : “+mysensors[3]+” kPa”), 380, 210);
text((“Pressure5 : “+mysensors[4]+” kPa”), 10, 270);
text((“Pressure6 : “+ mysensors[5] +” kPa”), 380, 270);
fill( 0, 0, 102); //dark blue
rect(650, 650, 50, 15);
fill(0, 0, 204); //light blue
rect(650, 630, 50, 15);
fill(102, 204, 255); //more light blue
rect(650, 610, 50, 15);
fill(0, 153, 0); //green
rect(650, 590, 50, 15);
fill(153, 255, 153); //light green
rect(650, 570, 50, 15);

fill(255, 255, 102); //yellow
rect(650, 550, 50, 15);
fill(255, 204, 0); //bright1
rect(650, 530, 50, 15);
fill(255, 0, 0); //red
rect(650, 510, 50, 15);
fill(204, 51, 0); //dark color
rect(650, 490, 50, 15);
fill( r1, g1, b1);
ellipse(x+(550), y, 55, 55);
fill( r2, g2, b2);
ellipse(x+(55
1), y, 55, 55);
fill( r3, g3, b3);
ellipse(x+(550), y+(551), 55, 55);
fill( r4, g4, b4);
ellipse(x+(551), y+(551), 55, 55);
fill( r5, g5, b5);
ellipse(x+(550),y+(552), 55, 55);
fill( r6, g6, b6);
ellipse(x+(551), y+(552), 55, 55);
}
void serialEvent ( Serial myPort) {
try {
while (myPort.available() > 0) {
data = myPort.readStringUntil(’\n’);
if (data != null)
{
data= trim(data);

mysensors = split(data, ‘,’);
}
}
for (int i = 0; i <5; i++) {
d[i]=float(mysensors[i]);
print(d[i]+" “);
}
for (int i = 0; i <5; i++) {
T[i]=float(mysensors[5+i]);
print(T[i]+” “);
}
println(”");
for (int i=0; i < 5; i++) {
c[i] = int((d[i]*9)/T[i]);
}
selectColor1();
selectColor2();
selectColor3();
selectColor4();
selectColor5();
}
catch (Exception e) {
println(“Initialization exception”);
// decide what to do here
}
}

void selectColor1() {
if (d[0] > T[0]) {
r1=255;
g1=0;
b1=0;
} else if (c[0]==0) {
r1=0;
g1=0;
b1=102;
} else if (c[0]==1) {
r1=0;
g1=0;
b1=204;
} else if (c[0]==2) {
r1=102;
g1=204;
b1=255;
} else if (c[0]==3) {
r1=0;
g1=153;
b1=0;
} else if (c[0]==4) {
r1=153;
g1=255;
b1=153;
} else if (c[0]==5) {
r1=255;
g1=255;
b1=102;
} else if (c[0]==6) {
r1=255;
g1=204;

b1=0;
} else if (c[0]==7) {
r1=255;
g1=0;
b1=0;
} else if (c[0]==8) {
r1=204;
g1=51;
b1=0;
}
}
void selectColor2() {
if (d[1] > T[1]) {
r2=255;
g2=0;
b2=0;
} else if (c[1]==0) {
r2=0;
g2=0;
b2=102;
} else if (c[1]==1) {
r2=0;
g2=0;
b2=204;
} else if (c[1]==2) {
r2=102;
g2=204;
b2=255;
} else if (c[1]==3) {
r2=0;
g2=153;

b2=0;
} else if (c[1]==4) {
r2=153;
g2=255;
b2=153;
} else if (c[1]==5) {
r2=255;
g2=255;
b2=102;
} else if (c[1]==6) {
r2=255;
g2=204;
b2=0;
} else if (c[1]==7) {
r2=255;
g2=0;
b2=0;
} else if (c[1]==8) {
r2=204;
g2=51;
b2=0;
}
}
void selectColor3() {
if (d[2] > T[2]) {
r3=255;
g3=0;
b3=0;
} else if (c[2]==0) {
r3=0;
g3=0;

b3=102;
} else if (c[2]==1) {
r3=0;
g3=0;
b3=204;
} else if (c[2]==2) {
r3=102;
g3=204;
b3=255;
} else if (c[2]==3) {
r3=0;
g3=153;
b3=0;
} else if (c[2]==4) {
r3=153;
g3=255;
b3=153;
} else if (c[2]==5) {
r3=255;
g3=255;
b3=102;
} else if (c[2]==6) {
r3=255;
g3=204;
b3=0;
} else if (c[2]==7) {
r3=255;
g3=0;
b3=0;
} else if (c[2]==8) {
r3=204;
g3=51;

b3=0;
}
}
void selectColor4() {
if (d[3] > T[3]) {
r4=255;
g4=0;
b4=0;
} else if (c[3]==0) {
r4=0;
g4=0;
b4=102;
} else if (c[3]==1) {
r4=0;
g4=0;
b4=204;
} else if (c[3]==2) {
r4=102;
g4=204;
b4=255;
} else if (c[3]==3) {
r4=0;
g4=153;
b4=0;
} else if (c[3]==4) {
r4=153;
g4=255;
b4=153;
} else if (c[3]==5) {
r4=255;
g4=255;

b4=102;
} else if (c[3]==6) {
r4=255;
g4=204;
b4=0;
} else if (c[3]==7) {
r4=255;
g4=0;
b4=0;
} else if (c[3]==8) {
r4=204;
g4=51;
b4=0;
}
}
void selectColor5() {
if (d[4] > T[4]) {
r5=255;
g5=0;
b5=0;
} else if (c[4]==0) {
r5=0;
g5=0;
b5=102;
} else if (c[4]==1) {
r5=0;
g5=0;
b5=204;
} else if (c[4]==2) {
r5=102;
g5=204;

b5=255;
} else if (c[4]==4) {
r5=0;
g5=153;
b5=0;
} else if (c[4]==4) {
r5=153;
g5=255;
b5=153;
} else if (c[4]==5) {
r5=255;
g5=255;
b5=102;
} else if (c[4]==6) {
r5=255;
g5=204;
b5=0;
} else if (c[4]==7) {
r5=255;
g5=0;
b5=0;
} else if (c[4]==8) {
r5=204;
g5=51;
b5=0;
}
}

In void selectColor use print to check what you are receiving

Format your code using
<√>

Hello @GalA ,

Welcome aboard!

Please format your code as a courtesy to the community:
https://discourse.processing.org/faq#format-your-code

Please only post an MCVE:

I will test this out once you simplify and format it and I can copy it without errors.

:)

Hi @GalA, " I need to submit this project ASAP." - I hope you have time to think about some improvements. At the moment several aspects of the code make it look like a rushed job without the time and study to understand programming principles and avoid errors. Suggestions:

The functions selectColor1…5 are identical except for the arrayindex and the rgbX vars used. Change selectColor1 to selectColor which accepts a parameter 0…4, this becomes the index to the array. Change the vars r1…b5 to 3 arrays. Now delete selectColor2…4 (Less code, neater, easier to work with.)

Don’t use single character variable names, no help to the reader, hard to search the code because the search finds other uses of the letter. r → red or colrRed.

Use String.format to fix the size of the text, stops it moving around depending on value. (Might have to adjust as I can’t see your value strings.) This also gives the possibility of using one display line with a loop.

old:  text((“Pressure1 : “+mysensors[0]+” kPa”), 10, 150);
new:  ix = 0;  text((String.format("Pressure %1d : %-12s kPa", ix+1, mysensors[ix])), 10, 150);

Where you have 3 loops 0…5 near line 93, you could have just 1 loop with all 6 action lines in that. Merge both prints into a String.format and the output will be more regular and easier to read.

You could go further with the colours, using vars of type color instead of r,g,b. You might like an array,
and that simplifies selectColor, and where you use the colour becomes fill(pressureColours[ix])

color pressureColours[] = new color[6];
void setup() {
pressureColours[0] = color(255,0,0);
...

Hope this helps.

2 Likes

Thanks for your help!


import processing.serial.*;
Serial port;
String[] mysensors = {"", "", "", "", "", "", "", "", "", ""};
String data="";
int x = 420;
int y = 500;
int x1=950;
int y1=750;
float[] d = {0, 0, 0, 0, 0};
float[] T = {0, 0, 0, 0, 0};
int r1=0, g1=0, b1=102;
int r2=0, g2=0, b2=102;
int r3=0, g3=0, b3=102;
int r4=0, g4=0, b4=102;
int r5=0, g5=0, b5=102;
int r6=0, g6=0, b6=102;
int p=0;
int[] c={0, 0, 0, 0, 0};
void setup() {
size(950, 750);
port = new Serial (this, "COM3", 9600);
port.write(0);
port.bufferUntil('\n');
}
void draw() {
background(0);
fill(0, 0, 102);

rect(0, 0, x1, 30);
stroke(0, 0, 102);
strokeWeight(4);
line(0, 95, x1, 95); //first horizontal line
line(0, 380, x1, 380); //first horizontal line
fill(102, 204, 255);
textSize(28);
text("Mattress for mapping and optimizing pressure for bedridden patients", 0, 80, -30);
textSize(32);
text("Pressure Map", 365, 430, -30);
noStroke();
text(("Pressure1 : "+mysensors[0]+" kPa"), 10, 150);
text(("Pressure2 : "+mysensors[1]+" kPa"), 380, 150);
text(("Pressure3 : "+mysensors[2]+" kPa"), 10, 210);
text(("Pressure4 : "+mysensors[3]+" kPa"), 380, 210);
text(("Pressure5 : "+mysensors[4]+" kPa"), 10, 270);
text(("Pressure6 : "+ mysensors[5] +" kPa"), 380, 270);
fill( 0, 0, 102); //dark blue
rect(650, 650, 50, 15);
fill(0, 0, 204); //light blue
rect(650, 630, 50, 15);
fill(102, 204, 255); //more light blue
rect(650, 610, 50, 15);
fill(0, 153, 0); //green
rect(650, 590, 50, 15);
fill(153, 255, 153); //light green
rect(650, 570, 50, 15);

fill(255, 255, 102); //yellow
rect(650, 550, 50, 15);
fill(255, 204, 0); //bright1
rect(650, 530, 50, 15);
fill(255, 0, 0); //red
rect(650, 510, 50, 15);
fill(204, 51, 0); //dark color
rect(650, 490, 50, 15);
fill( r1, g1, b1);
ellipse(x+(55*0), y, 55, 55);
fill( r2, g2, b2);
ellipse(x+(55*1), y, 55, 55);
fill( r3, g3, b3);
ellipse(x+(55*0), y+(55*1), 55, 55);
fill( r4, g4, b4);
ellipse(x+(55*1), y+(55*1), 55, 55);
fill( r5, g5, b5);
ellipse(x+(55*0),y+(55*2), 55, 55);
fill( r6, g6, b6);
ellipse(x+(55*1), y+(55*2), 55, 55);
}
void serialEvent ( Serial myPort) {
try {
while (myPort.available() > 0) {
data = myPort.readStringUntil('\n');
if (data != null)
{
data= trim(data);

mysensors = split(data, ',');
}
}
for (int i = 0; i <5; i++) {
d[i]=float(mysensors[i]);
print(d[i]+" ");
}
for (int i = 0; i <5; i++) {
T[i]=float(mysensors[5+i]);
print(T[i]+" ");
}
println("");
for (int i=0; i < 5; i++) {
c[i] = int((d[i]*9)/T[i]);
}
selectColor1();
selectColor2();
selectColor3();
selectColor4();
selectColor5();
}
catch (Exception e) {
println("Initialization exception");
// decide what to do here
}
}

void selectColor1() {
if (d[0] > T[0]) {
r1=255;
g1=0;
b1=0;
} else if (c[0]==0) {
r1=0;
g1=0;
b1=102;
} else if (c[0]==1) {
r1=0;
g1=0;
b1=204;
} else if (c[0]==2) {
r1=102;
g1=204;
b1=255;
} else if (c[0]==3) {
r1=0;
g1=153;
b1=0;
} else if (c[0]==4) {
r1=153;
g1=255;
b1=153;
} else if (c[0]==5) {
r1=255;
g1=255;
b1=102;
} else if (c[0]==6) {
r1=255;
g1=204;

b1=0;
} else if (c[0]==7) {
r1=255;
g1=0;
b1=0;
} else if (c[0]==8) {
r1=204;
g1=51;
b1=0;
}
}
void selectColor2() {
if (d[1] > T[1]) {
r2=255;
g2=0;
b2=0;
} else if (c[1]==0) {
r2=0;
g2=0;
b2=102;
} else if (c[1]==1) {
r2=0;
g2=0;
b2=204;
} else if (c[1]==2) {
r2=102;
g2=204;
b2=255;
} else if (c[1]==3) {
r2=0;
g2=153;

b2=0;
} else if (c[1]==4) {
r2=153;
g2=255;
b2=153;
} else if (c[1]==5) {
r2=255;
g2=255;
b2=102;
} else if (c[1]==6) {
r2=255;
g2=204;
b2=0;
} else if (c[1]==7) {
r2=255;
g2=0;
b2=0;
} else if (c[1]==8) {
r2=204;
g2=51;
b2=0;
}
}
void selectColor3() {
if (d[2] > T[2]) {
r3=255;
g3=0;
b3=0;
} else if (c[2]==0) {
r3=0;
g3=0;

b3=102;
} else if (c[2]==1) {
r3=0;
g3=0;
b3=204;
} else if (c[2]==2) {
r3=102;
g3=204;
b3=255;
} else if (c[2]==3) {
r3=0;
g3=153;
b3=0;
} else if (c[2]==4) {
r3=153;
g3=255;
b3=153;
} else if (c[2]==5) {
r3=255;
g3=255;
b3=102;
} else if (c[2]==6) {
r3=255;
g3=204;
b3=0;
} else if (c[2]==7) {
r3=255;
g3=0;
b3=0;
} else if (c[2]==8) {
r3=204;
g3=51;

b3=0;
}
}
void selectColor4() {
if (d[3] > T[3]) {
r4=255;
g4=0;
b4=0;
} else if (c[3]==0) {
r4=0;
g4=0;
b4=102;
} else if (c[3]==1) {
r4=0;
g4=0;
b4=204;
} else if (c[3]==2) {
r4=102;
g4=204;
b4=255;
} else if (c[3]==3) {
r4=0;
g4=153;
b4=0;
} else if (c[3]==4) {
r4=153;
g4=255;
b4=153;
} else if (c[3]==5) {
r4=255;
g4=255;

b4=102;
} else if (c[3]==6) {
r4=255;
g4=204;
b4=0;
} else if (c[3]==7) {
r4=255;
g4=0;
b4=0;
} else if (c[3]==8) {
r4=204;
g4=51;
b4=0;
}
}
void selectColor5() {
if (d[4] > T[4]) {
r5=255;
g5=0;
b5=0;
} else if (c[4]==0) {
r5=0;
g5=0;
b5=102;
} else if (c[4]==1) {
r5=0;
g5=0;
b5=204;
} else if (c[4]==2) {
r5=102;
g5=204;

b5=255;
} else if (c[4]==4) {
r5=0;
g5=153;
b5=0;
} else if (c[4]==4) {
r5=153;
g5=255;
b5=153;
} else if (c[4]==5) {
r5=255;
g5=255;
b5=102;
} else if (c[4]==6) {
r5=255;
g5=204;
b5=0;
} else if (c[4]==7) {
r5=255;
g5=0;
b5=0;
} else if (c[4]==8) {
r5=204;
g5=51;
b5=0;
}
}