String matos [26]= { "Pipet 5ml", "Pipet 10ml", "Pipet 25 ml","Pipet Pasteur", "Tips 1000", "Tips 200", "Tips 20", "Tips 10 ", "Tips no Filter", "Eppi 2ml", "Eppi 1,5ml", "Eppi 0,5ml", "Gloves S", "Gloves M","Gloves L", "Falcon 15","Falcon 50", "Flask 25", "Flask 75", "Flask 150", "Surfanios", "Wipes", "White Bag", "Red bag", "Pipet Bag", "Tips bag" };
You do NOT need to piss away resources on the String class, wrapping constant strings. Change the type to const char *.
#if defined(MCUFRIEND_KBV_H_)
uint16_t scrollbuf[320]; // my biggest screen is 320x480
#define READGRAM(x, y, buf, w, h) tft.readGRAM(x, y, buf, w, h)
#else
uint16_t scrollbuf[320]; // Adafruit only does 240x320
// Adafruit can read a block by one pixel at a time
int16_t READGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h)
{
uint16_t *p;
for (int row = 0; row < h; row++) {
p = block + row * w;
for (int col = 0; col < w; col++) {
*p++ = tft.readPixel(x + col, y + row);
}
}
}
#endif
Get your enter key fixed. Use white space. It's free.
// draw screen and button
tft.fillScreen(BLACK);
tft.drawRect(1, 1, 319, 20, WHITE);
tft.fillRect(2, 2, 317, 18, YELLOW);
tft.setTextSize(1);
tft.setTextColor(BLACK);
tft.setCursor(10,5);
Were you drunk when you typed this mess. Sober up, and use Tools + Auto Format, so you look like you car what you code looks like.
Put the button handling code in a function. Get all that out of loop().
Learn to use arrays. That code could be MUCH shorter, since it is so repetitious.
Buffer[0]=table[0];
Buffer[1]=table[1];
Buffer[2]=table[2];
Buffer[3]=table[3];
Buffer[4]=table[4];
Buffer[5]=table[5];
Buffer[6]=table[6];
Buffer[7]=table[7];
Buffer[8]=table[8];
Buffer[9]=table[9];
Buffer[10]=table[10];
Buffer[11]=table[11];
Buffer[12]=table[12];
Buffer[13]=table[13];
Buffer[14]=table[14];
Buffer[15]=table[15];
Buffer[16]=table[16];
Buffer[17]=table[17];
Buffer[18]=table[18];
Buffer[19]=table[19];
Buffer[20]=table[20];
Buffer[21]=table[21];
Buffer[22]=table[22];
Buffer[23]=table[23];
Buffer[24]=table[24];
Buffer[25]=table[25];
4 lines of code bloated to 25. Why? Are you paid by the line? Use a for loop!
If someone has a hint, i will appreciate
I can't even make sense of your code, because it is laid out so poorly. Put EVERY { on a line BY ITSELF. Put EVERY } on a line BY ITSELF. Use Tools + Auto Format.
I do NOT see any reason why you should have to press a button or hold your nose just right, or anything else, to handle a client request, since the call to webserver() is the last statement in loop(), and will be unconditionally executed, on every pass through loop().