prenticedavid / Adafruit_ST7796S_kbv

Adafruit-style library for ST7796S SPI displays
Other
19 stars 0 forks source link

The library isn't working ! #1

Closed eagl1 closed 1 year ago

eagl1 commented 1 year ago

I got several errors.

prenticedavid commented 1 year ago

It is always wise to start by building and running the examples that come with the library.

If you have a problem :

  1. quote library example by name
  2. say which Arduino board you are using
  3. post a link to the actual display that you have bought. e.g. Ebay sale page

Just saying "several errors" without giving any indication of "what" errors is not useful.

There is no point in writing "your own" code until you have run the examples.

David.

eagl1 commented 1 year ago

I had this in my mind but I didn't know the author would reply. Anyway, hay david how are you ? I know you from Arduino forum, you helped me a lot in many occasions so I really appreciate you.

  1. The example is the "graphictest", the error comes up when I compile the code before programming.
Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"

In file included from D:\Program_Files\Arduino\libraries\Adafruit_ST7796S_kbv-master\examples\graphicstest\graphicstest.ino:18:0:

D:\Program_Files\Arduino\libraries\Adafruit_ST7796S_kbv-master/Adafruit_ST7796S_kbv.h:114:36: error: expected ')' before 'busWidth'

   Adafruit_ST7796S_kbv(tftBusWidth busWidth, int8_t d0, int8_t wr, int8_t dc,

                                    ^~~~~~~~

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
  1. I'm using Arduino uno.
  2. the display is this one: https://www.aliexpress.com/item/4001023046595.html?spm=a2g0o.order_list.0.0.7b901802OfFxfw

It's working with another library from LCDWIKI: http://www.lcdwiki.com/4.0inch_SPI_Module_ST7796

prenticedavid commented 1 year ago

I imported the ZIP from GitHub into the Web Editor. This means that the Arduino example sketch uses the exact GitHub library and up to date public libraries e.g.

Using library SPI at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/SPI

Using library adafruit_gfx_library_1_11_3 at version 1.11.3 in folder: /home/builder/opt/libraries/adafruit_gfx_library_1_11_3

Using library adafruit_busio_1_13_2 at version 1.13.2 in folder: /home/builder/opt/libraries/adafruit_busio_1_13_2

Using library Wire at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire

Using library Adafruit ST7796S kbv at version 1.0.0 in folder: /mnt/create-efs/webide/0a/33/0a33bd1179c57bfa4a19d1bd3e6cef93:david_prentice/libraries_v2/Adafruit ST7796S kbv

/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /tmp/arduino-build-FD6B684CDADF20F65A4BC4704857633C/graphicstest.ino.elf

Sketch uses 20042 bytes (62%) of program storage space. Maximum is 32256 bytes.

and it is running quite nicely on a Uno clone. (with level shifters on CS, MOSI, SCK, DC, RST, ...)

I suggest that you look at the versions of Adafruit_GFX, busio etc

The examples never use the "busWidth" constructor. The display is strictly SPI.

David.

eagl1 commented 1 year ago

wow you're right ! I forgot about updating the libraries.

even I didn't have "Adafruit_BusIO-master", I had to download it.

Sketch uses 20042 bytes (62%) of program storage space. Maximum is 32256 bytes.
Global variables use 726 bytes (35%) of dynamic memory, leaving 1322 bytes for local variables. Maximum is 2048 bytes.

It works perfectly without even warnings.

Thanks man :)