ESP32-Audio-Spectrum-Waveform-Display icon indicating copy to clipboard operation
ESP32-Audio-Spectrum-Waveform-Display copied to clipboard

Problem on ILI9341

Open momosh13 opened this issue 5 years ago • 12 comments

Hello Great Library. I have this setup, WEMOS LOLIN32 + ILI9341, I'm trying to use this library, and the display shows this, please see the picture, please tell me what I'm doing wrong?

This is my defines: #define TFT_RST 2 #define SPI_MISO 25 #define SPI_MOSI 23 #define SPI_CLK 18 #define LCD_BL_CTR 0 #define TFT_CS 5 #define TFT_DC 4 #include <Adafruit_ILI9341.h> #include <Adafruit_GFX.h> Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC); #define min(X, Y) (((X) < (Y)) ? (X) : (Y)) #define max(X, Y) (((X) > (Y)) ? (X) : (Y))

Please help me to fix this.

0

momosh13 avatar Apr 27 '20 07:04 momosh13

Hello,

I can't find any information on ILI9433, are you sure that's the exact model name ?

If you see something on the screen, then your defines are good, what I see on your photo looks more like a display driver issue.

tobozo avatar Apr 27 '20 11:04 tobozo

I'm very sorry, it's ILI9341

momosh13 avatar Apr 27 '20 16:04 momosh13

please specifty what branch you're using

the latest changes are on the odroid-go branch

also I'd look into setRotation() value as it seems width and height are inverted on your screenshot

tobozo avatar Apr 27 '20 19:04 tobozo

Yes Branch, Latest commit on Jul 28, 2018 Adafruit example works fine, when I'm changing tft.setRotation( 1 ) to 1,2,3 it simple rotates the screen, please see the pictures IMG_2271 IMG_2272 IMG_2273 IMG_2275

momosh13 avatar Apr 27 '20 22:04 momosh13

What's the value of A0 on this board ? Did you attach an amplified microphone unit to that pin ?

tobozo avatar Apr 27 '20 23:04 tobozo

It's open, just ESP32 board

momosh13 avatar Apr 27 '20 23:04 momosh13

What were you planning to use as a sound source ? This is a sound-based project :-)

tobozo avatar Apr 28 '20 00:04 tobozo

Ok let me connected mic preamp to it, and I'll let you know

momosh13 avatar Apr 28 '20 00:04 momosh13

So this is what i'm getting, with amplifier attached A0 input IMG_2279

momosh13 avatar Apr 28 '20 00:04 momosh13

looks much better

you may try to issue the a command in the serial interface, it toggles the adc reading mode, maybe it'll get rid of this saturation on higher frequencies

v, w and s will toggle visual modes respectively for the volume, waveform and spectrometer

I suggest you try the other commands only after you've played enough with a, v, w and s

tobozo avatar Apr 28 '20 01:04 tobozo

Hi So finally It's working ! after this changes:

//#ifdef ILI9341_TFTWIDTH //#define TFT_WIDTH ILI9341_TFTWIDTH //#else #define TFT_WIDTH 320 //#endif //#ifdef ILI9341_TFTHEIGHT //#define TFT_HEIGHT ILI9341_TFTHEIGHT //#else #define TFT_HEIGHT 240 //#endif

One more question, if you have time, can you add one more "Spectro" option, like in a picture, with solid bars. Please.

One more time. Thank you for this beautiful work !!!

IMG_2316

image

momosh13 avatar Apr 28 '20 19:04 momosh13

Good to know you got it working ^^

It's faster to draw lines than filling blocks, while doing so with an OLED screen using 1bit color isn't a problem, it can be a drawback on a TFT using 16 bit colors.

The only real improvement this project could benefit from is using tasks, one task for the audio sampling, and one for the display rendering.

The hardware from this project is now on a new project so I can't test this sketch anymore, but contributions are welcome !

The new project uses a smaller rendering zone to cope with the update speed : video

tobozo avatar Apr 29 '20 14:04 tobozo