I cant use spi.h

i cant use spi.h cuz i got this error

C:\Users\mango\OneDrive\Belgeler\Arduino\sketch_jul08a\sketch_jul08a.ino:1:10: fatal error: SPI.h: No such file or directory
 #include <SPI.h>
          ^~~~~~~
compilation terminated.

exit status 1

Compilation error: SPI.h: No such file or directory

but my code includes spi.h library
code

#include <SPI.h>

#include <nRF24L01.h>

#include <RF24.h>

RF24 radio(5, 6); // CE, CSN

const byte address[6] = "hey";

void setup() {

radio.begin();

radio.openWritingPipe(address);

radio.setPALevel(RF24_PA_MIN);

radio.stopListening();

SPI.begin();

}

void loop() {

const char text[] = "Hello World"; // maksimium 32 karakter olabilir

radio.write(&text, sizeof(text));

delay(1000);

}

can someone help me?

radio.begin(); already calls SPI.begin();.

No need to include SPI.h, no need to call SPI.begin.

Your pipe address is too short, and uses one byte after the variable, so it could happen,
that two of these pipes addresses, in RX and TX sketch for instance, are different.

its not matter, i tried leonardo and uno all the boards are have this error

it needs cuz if i dont i got this error

In file included from c:\Users\fb190\OneDrive\Belgeler\Arduino\libraries\RF24-master/RF24.h:18:0,
                 from C:\Users\fb190\OneDrive\Belgeler\Arduino\sketch_jul08a\sketch_jul08a.ino:2:
c:\Users\mango\OneDrive\Belgeler\Arduino\libraries\RF24-master/RF24_config.h:126:22: fatal error: SPI.h: No such file or directory
             #include <SPI.h>
                      ^~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

i understand u but its not worked

İ FİXED İT GUYS !!!!11!!!1!!!!!!!!111
if anyone else experiences this, there is a solution
delete everything about arduino and library you dont need to delete your sketches just delete library files and ıde files

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.