tobozo / ESP32-Audio-Spectrum-Waveform-Display

using an ESP32 and OLED display together with an FFT to display 8-octaves of audio in the frequency domain
45 stars 12 forks source link

Problem on ILI9341 #3

Open momosh13 opened 4 years ago

momosh13 commented 4 years ago

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

include

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

tobozo commented 4 years ago

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.

momosh13 commented 4 years ago

I'm very sorry, it's ILI9341

tobozo commented 4 years ago

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

momosh13 commented 4 years ago

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

tobozo commented 4 years ago

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

momosh13 commented 4 years ago

It's open, just ESP32 board

tobozo commented 4 years ago

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

momosh13 commented 4 years ago

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

momosh13 commented 4 years ago

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

tobozo commented 4 years ago

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

momosh13 commented 4 years ago

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
tobozo commented 4 years ago

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