Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Where is SPI.h?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Where is SPI.h?

by madsamurai on Sat Apr 17, 2021 3:45 pm

Apologies if this has been asked before, but I didn't have any luck with the search.

I'm trying to run the "graphicstest" example from the ST7789 library on a Digispark Pro. It begins with:
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

which results in:
Code: Select all | TOGGLE FULL SIZE
In file included from /Volumes/.../Documents/Arduino/libraries/Adafruit_ST7735_and_ST7789_Library/Adafruit_ST77xx.h:31:0,
                 from /Volumes/.../Documents/Arduino/libraries/Adafruit_ST7735_and_ST7789_Library/Adafruit_ST7735.h:4,
                 from Volumes/.../Documents/Arduino/libraries/Adafruit_ST7735_and_ST7789_Library/examples/graphicstest/graphicstest.ino:34:
/Volumes/.../Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.h:26:10: fatal error: SPI.h: No such file or directory
 #include <SPI.h>
          ^~~~~~~
compilation terminated.
exit status 1
Error compiling for board Digispark Pro (16 MHz).


It seems to be related to the Digispark board, as it compiles properly for Arduino Nano, but that doesn't make sense to me... I've searched my system for SPI.h and it does not exist anywhere, so I don't know how it's able to find it for Nano. Can anyone explain to me what's actually happening and how I can make it work?

madsamurai
 
Posts: 3
Joined: Sat Apr 17, 2021 3:14 pm

Re: Where is SPI.h?

by blnkjns on Sun Apr 18, 2021 8:27 am

Remove it. I never include SPI.h, Wire.h or Serial.h.
Guess it was needed on old IDE's, but not the recent ones.

blnkjns
 
Posts: 455
Joined: Fri Oct 02, 2020 3:33 am

Re: Where is SPI.h?

by madsamurai on Sun Apr 18, 2021 7:44 pm

That's interesting... I tried removing it from my script, however a number of the adafruit libraries seem to include it, so no joy unless I modify them as well. Not sure if I can do that without breaking other things.

madsamurai
 
Posts: 3
Joined: Sat Apr 17, 2021 3:14 pm

Re: Where is SPI.h?

by blnkjns on Mon Apr 19, 2021 5:10 am

Another reason can be that the library simply does not work with the board, or only in a special way. Try doing some research on SPI with Digispark.
I found this:
https://forum.arduino.cc/t/how-to-fix-t ... ary/575670

blnkjns
 
Posts: 455
Joined: Fri Oct 02, 2020 3:33 am

Re: Where is SPI.h?

by madsamurai on Mon Apr 19, 2021 9:58 am

Yeah, I did find after posting here, and a few posts on the digistump forum with solutions that didn't make any sense (the windows file structure is apparently much different than the macOS file structure in the arduino app files). I'm going to close this and just assume this is one more thing I can't do with the Digispark Pro... which includes three other projects I've tried to use it and failed for other reasons. What a waste. I've got another 3-pack of Nano on the way; it runs without any headaches on that. Thanks for trying to help.

madsamurai
 
Posts: 3
Joined: Sat Apr 17, 2021 3:14 pm

Please be positive and constructive with your questions and comments.