I Have a small arduino atmega 328p based sensor board.
I want too be able to choose which wireless board (NRF24L01 or SX1278) I hard connect to it without reprogramming it, it may be fast and useful for my distance tests.
I actually use those libraries separately with success :
- #include <nRF24L01.h> // git clone https://github.com/nRF24
- #include <LoRa.h> // git clone https://github.com/sandeepmistry/arduino-LoRa.git
The problem is that if I use one library with the matching chip disconnected, when I will initialise it, my atmega will freeze (get stuck and do nothing).
So I wonder how to check if a SPI module is physically connected and how recognize which one it is so I could initialise the corresponding library or simply go to deep sleep.
How could I easily do this SPI check?
Thanks for reading, sorry for my poor English level