Page 2 of 2

Re: blue pill and ILI9341 tft

Posted: Tue Mar 17, 2020 2:52 pm
by svod616
Yes it really works! library
ag123 wrote: Tue Mar 17, 2020 11:37 am https://github.com/adafruit/Adafruit_ILI9341
came up beautifully, thank you very much!
I used the following initialization command:

Code: Select all

Adafruit_ILI9341 tft = Adafruit_ILI9341(PA4,PB1,PA7,PA5,PB10,PA6);
and it worked, the connection is as follows:

TFT_CS - PA4, TFT_DC - PB1, TFT_MOSI - PA7, TFT_CLK - PA5, TFT_RST - PB10, TFT_MISO - PA6

but I have one more question: Could you point me to the documentation for this library with a list of commands and arguments for them?
and there is still a question on increasing FPS: is this possible?

Re: blue pill and ILI9341 tft

Posted: Tue Mar 17, 2020 4:46 pm
by ag123
run the examples

Re: blue pill and ILI9341 tft

Posted: Tue Mar 17, 2020 9:13 pm
by stas2z
svod616 wrote: Tue Mar 17, 2020 2:52 pm and there is still a question on increasing FPS: is this possible?
by using constructor for hardware spi
Adafruit_ILI9341(int8_t _CS, int8_t _DC, int8_t _RST = -1);

now you are using software bitbanging

Re: blue pill and ILI9341 tft

Posted: Thu Mar 19, 2020 8:49 am
by svod616
stas2z wrote: Tue Mar 17, 2020 9:13 pm
svod616 wrote: Tue Mar 17, 2020 2:52 pm and there is still a question on increasing FPS: is this possible?
by using constructor for hardware spi
Adafruit_ILI9341(int8_t _CS, int8_t _DC, int8_t _RST = -1);
Thank you, this really doubled the FPS.
After mega8 looks impressive.

Re: blue pill and ILI9341 tft

Posted: Thu Mar 19, 2020 9:02 am
by svod616
ag123 wrote: Tue Mar 17, 2020 4:46 pmrun the examples
yes, I ran an example. I was able to easily replace the displayed text, its color and position in the example. However, when I try to modify the code called in the example like this

Code: Select all

Serial.println(testLines(ILI9341_CYAN));

Code: Select all

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();

  tft.fillScreen(ILI9341_BLACK);
  yield();
  
  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);

  yield();
  return micros() - start;
}
To get started, I wanted to change the calculation of coordinates here. But when you try to change at least something related to tft.drawLine () in this code, the compiler gives a lot of errors.
(there was a power failure, so I lost this part of the code. I will continue today, so I will quickly give an example of my code modification and copy the compiler errors)
maybe there is some kind of documentation like this: https://github.com/dgolda/UTFT/blob/master/UTFT.pdf

Re: blue pill and ILI9341 tft

Posted: Sun May 17, 2020 1:03 pm
by Kenjutsu
stas2z wrote: Tue Mar 17, 2020 9:13 pm by using constructor for hardware spi
Adafruit_ILI9341(int8_t _CS, int8_t _DC, int8_t _RST = -1);
Thank you for this, and just to confirm that I could only get hardware SPI working using the three parameter constructor with RST specified, and not the two parameter constructor with only CS and DC. ;)