adafruit / TFTLCD-Library

Arduino library for 8-bit TFT LCDs such as ILI9325, ILI9328, etc
http://www.ladyada.net/products/tfttouchbreakout/ and http://www.ladyada.net/products/tfttouchshield
314 stars 259 forks source link

Fixing missing SPI include for tftbmp examples #11

Closed myoung34 closed 9 years ago

myoung34 commented 10 years ago

Fixed the filename to line up with the 2.8"tft example

Without the SPI.h include the errors become:

Arduino: 1.5.4 (Windows NT (unknown)), Board: "Arduino Uno"

C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp: In function 'void spiSend(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp:54: error: 'SPI' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp: In function 'uint8_t spiRec()':
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp:81: error: 'SPI' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::init(uint8_t, uint8_t, int8_t, int8_t, int8_t)':
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp:326: error: 'SPI' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::setSckRate(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\SD\utility\Sd2Card.cpp:585: error: 'SPI' was not declared in this scope

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
myoung34 commented 10 years ago

Edited. Can't forget about us old school 2.8" TFT owners. The example doesn't work at all as-is. Might hurt beginners. This current tftbmp code works with the tutorial, meaning all pieces of that tutorial work with the original 2.8" TFT.

tdicola commented 9 years ago

Thanks for sending the pull request and apologies it wasn't reviewed sooner. Just submitted a fix to add the missing SPI.h header to the example. I tried the changes in this pull though and had some issues with the display not showing anything. I think the SPI saving/restoring might be causing problems. In particular it looks like there's a disableSPI call added right before drawBMP, which needs SPI to read the data from the SD card. I'll close this pull for now, but feel free to submit another pull with any changes or fixes. Thanks!