Several examples not showing after added a library to project

I have added this RF24 library to my project.

I can find some examples in the examples folder, but I notice some of the examples are not showing in it. For example, the scanner example in the above picture is not showing in the examples folder.

Anyone know why?

The scanner example is there and the first in the list. On the library information webpage, PlatformIO Registry, it also shows the scanner.ino example. All examples from the source are present there.

Hi maxgerhardt, how should I navigate to open then scanner example? Because I can’t find it in the examples folder at the left:

You can just copy it from examples/old_backups/scanner/scanner.ino into your src/ folder. Or, copy-paste the code from the PIO Home -> Libraries -> RF24 -> Examples -> scanner page into the file.

When I try to build it after I copied the code into my main.cpp, the error below occurs:

In file included from .pio\libdeps\nanoatmega328\RF24\RF24.cpp:10:0:
.pio\libdeps\nanoatmega328\RF24\RF24_config.h:93:29: fatal error: SPI.h: No such file or directory

I have searched through Internet and it turns out that the SPI.h is an inbuilt file. I have also found post citing the same problem but I don’t understand the solution in it. Please guide me through this.

The source file is an .ino file, not a .cpp file.

Also you can add #include <SPI.h> at the top of the file to make PlatformIO recognize the dependency.

1 Like

It works!! Thanks a lot.