I’m working on a project for IoT.
I have created a library for a web server. In this library I have to include another library which depends on the hardware I use.
So in the .h (header) file of my library I wrote the code:
#ifdef enc28j60 #include <UIPEthernet.h> #else #include <Ethernet.h> #include <SPI.h> #endif
In my .ino file I wrote the code:
#define enc28j60 // comment this line if you're using an ethernet module with W5100 chip
The code runs the “else” part of the “ifdef stracture” either I comment the “define” statement or not.
Any suggestions how to make it work ??