I’ve got a very basic question, but I cannot figure out how to solve it.
When using the SPI.begin(), SPI.transfer() commands as described in https://docs.particle.io/reference/firmware/photon/#spi this works perfectly fine in the .ino file.
However when I create a file subroutine.cpp and try to call SPI.begin() or SPI.transfer() from this file I receive the
error: 'SPI' was not declared in this scope
I tried including:
but this results in a
fatal error: SPI.h: No such file or directory
I assume this has something todo with running the .ino code through a pre-processor (Multiple files in Spark Build IDE) and not the .cpp code?
So to summarise: how to call the SPI commands from a non-.ino file?
Photon firmware: 0.6.0
Using the web IDE: https://build.particle.io/