Redefinition of 'RF24 radio' error message on compilation

Hi there, newbie on Arduino. I doing some test with ATtiny85 and 3 pins NRF24L01. When trying this code

#define CE_PIN 3
#define CSN_PIN 3 //Since we are using 3 pin configuration we will use same pin for both CE and CSN

#include "RF24.h"

RF24 radio(CE_PIN, CSN_PIN);

byte address[11] = "SimpleNode";
unsigned long payload = 0;

void setup() {
  radio.begin(); // Start up the radio
  radio.setAutoAck(1); // Ensure autoACK is enabled
  radio.setRetries(15,15); // Max delay between retries & number of retries
  radio.openWritingPipe(address); // Write to device address 'SimpleNode'
}

void loop(void){
  payload++;
  radio.write( &payload, sizeof(unsigned long) ); //Send data to 'Receiver' ever second
  delay(1000);
}

I get redefinition of ‘RF24 radio’ error message on compilation

please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. It’s unreadable as it stands. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlT on a PC or cmdT on a Mac)


CE_PIN and CSN_PIN definitions are commented out how can RF24 radio(CE_PIN, CSN_PIN); even compile ?

You are on a ATtiny85 where memory is quite limited… do you want 11 bytes when only 5 are needed? byte address[11] = “SimpleNode”;

Please follow the advice given in the link below when posting code

Your code as posted with no code tags contains invalid characters when copied to the IDE for examination

1 Like

Thk for advice, just did correction. Removed comment for CE_PIN and CSN_PIN as I did test earlier with hardcoding pin number like this RF24 radio(3, 3);

so are you still getting a compile error?

can you try with the code looking like this?

#include <RF24.h>

RF24 radio(3, 3);

uint8_t address[] = {0xCC, 0xCE, 0xCC, 0xCE, 0xCC};
unsigned long payload = 0;

void setup() {
  radio.begin(); // Start up the radio
  radio.setAutoAck(1); // Ensure autoACK is enabled
  radio.setRetries(15,15); // Max delay between retries & number of retries
  radio.setPALevel(RF24_PA_LOW);
  radio.setPayloadSize(sizeof(unsigned long));
  radio.openWritingPipe(address);
  radio.stopListening();
}

void loop(void){
  payload++;
  radio.write( &payload, sizeof(unsigned long) ); //Send data to 'Receiver' ever second
  delay(1000);
}

(I guess you are following this instructables example?)

I got the same compile error with my new code. I just try the code you summit and get a different error

Arduino: 1.8.13 (Windows 10), Board: "ATtiny*5 Series, ATtiny85, 8 MHz (internal)"





















C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Proprietaire\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Proprietaire\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries -fqbn=attiny:avr:ATtinyX5:cpu=attiny85,clock=internal8 -ide-version=10813 -build-path C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541 -warnings=none -build-cache C:\Users\PROPRI~1\AppData\Local\Temp\arduino_cache_36373 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=C:\Users\Proprietaire\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=C:\Users\Proprietaire\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Proprietaire\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Proprietaire\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries -fqbn=attiny:avr:ATtinyX5:cpu=attiny85,clock=internal8 -ide-version=10813 -build-path C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541 -warnings=none -build-cache C:\Users\PROPRI~1\AppData\Local\Temp\arduino_cache_36373 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=C:\Users\Proprietaire\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.0.1-arduino5.path=C:\Users\Proprietaire\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino

Using board 'ATtinyX5' from platform in folder: C:\Users\Proprietaire\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2

Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

Detecting libraries used...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for RF24.h: [RF24@1.4.0]

ResolveLibrary(RF24.h)

  -> candidates: [RF24@1.4.0]

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for SPI.h: [SPI@1.0]

ResolveLibrary(SPI.h)

  -> candidates: [SPI@1.0]

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24\\utility" "C:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24\\RF24.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src\\SPI.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp" -o "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10813 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Users\\Proprietaire\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "-IC:\\Users\\Proprietaire\\OneDrive - Agriculture Pangea\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp" -o "C:\\Users\\PROPRI~1\\AppData\\Local\\Temp\\arduino_build_263541\\sketch\\test2.ino.cpp.o"

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In member function 'void SPISettings::init_AlwaysInline(uint32_t, uint8_t, uint8_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:16: error: 'SPE' was not declared in this scope

     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

                ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:16: note: suggested alternative: 'SPH'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:27: error: 'MSTR' was not declared in this scope

     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:27: note: suggested alternative: 'PSTR'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:65: error: 'DORD' was not declared in this scope

     spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

                                                                 ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:65: note: suggested alternative: 'DDRB'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::beginTransaction(SPISettings)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:203:5: error: 'SPCR' was not declared in this scope

     SPCR = settings.spcr;

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:203:5: note: suggested alternative: 'EECR'

     SPCR = settings.spcr;

     ^~~~

     EECR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:204:5: error: 'SPSR' was not declared in this scope

     SPSR = settings.spsr;

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:204:5: note: suggested alternative: 'ACSR'

     SPSR = settings.spsr;

     ^~~~

     ACSR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static uint8_t SPIClass::transfer(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:209:5: error: 'SPDR' was not declared in this scope

     SPDR = data;

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:209:5: note: suggested alternative: 'EEDR'

     SPDR = data;

     ^~~~

     EEDR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:14: error: 'SPSR' was not declared in this scope

     while (!(SPSR & _BV(SPIF))) ; // wait

              ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:14: note: suggested alternative: 'ACSR'

     while (!(SPSR & _BV(SPIF))) ; // wait

              ^~~~

              ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:25: error: 'SPIF' was not declared in this scope

     while (!(SPSR & _BV(SPIF))) ; // wait

                         ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:25: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static uint16_t SPIClass::transfer16(uint16_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:11: error: 'SPCR' was not declared in this scope

     if (!(SPCR & _BV(DORD))) {

           ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:11: note: suggested alternative: 'EECR'

     if (!(SPCR & _BV(DORD))) {

           ^~~~

           EECR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:22: error: 'DORD' was not declared in this scope

     if (!(SPCR & _BV(DORD))) {

                      ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:223:22: note: suggested alternative: 'DDRB'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:224:7: error: 'SPDR' was not declared in this scope

       SPDR = in.msb;

       ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:224:7: note: suggested alternative: 'EEDR'

       SPDR = in.msb;

       ^~~~

       EEDR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:16: error: 'SPSR' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:16: note: suggested alternative: 'ACSR'

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

                ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:226:27: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:16: error: 'SPSR' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:16: note: suggested alternative: 'ACSR'

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

                ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:230:27: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:233:7: error: 'SPDR' was not declared in this scope

       SPDR = in.lsb;

       ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:233:7: note: suggested alternative: 'EEDR'

       SPDR = in.lsb;

       ^~~~

       EEDR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:16: error: 'SPSR' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:16: note: suggested alternative: 'ACSR'

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

                ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:235:27: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:16: error: 'SPSR' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:16: note: suggested alternative: 'ACSR'

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

                ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:239:27: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::transfer(void*, size_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:247:5: error: 'SPDR' was not declared in this scope

     SPDR = *p;

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:247:5: note: suggested alternative: 'EEDR'

     SPDR = *p;

     ^~~~

     EEDR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:16: error: 'SPSR' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:16: note: suggested alternative: 'ACSR'

       while (!(SPSR & _BV(SPIF))) ;

                ^~~~

                ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:27: error: 'SPIF' was not declared in this scope

       while (!(SPSR & _BV(SPIF))) ;

                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:250:27: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:14: error: 'SPSR' was not declared in this scope

     while (!(SPSR & _BV(SPIF))) ;

              ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:14: note: suggested alternative: 'ACSR'

     while (!(SPSR & _BV(SPIF))) ;

              ^~~~

              ACSR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:25: error: 'SPIF' was not declared in this scope

     while (!(SPSR & _BV(SPIF))) ;

                         ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:255:25: note: suggested alternative: '_SPI'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setBitOrder(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:31: error: 'SPCR' was not declared in this scope

     if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);

                               ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:31: note: suggested alternative: 'EECR'

     if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);

                               ^~~~

                               EECR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:43: error: 'DORD' was not declared in this scope

     if (bitOrder == LSBFIRST) SPCR |= _BV(DORD);

                                           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:292:43: note: suggested alternative: 'DDRB'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:10: error: 'SPCR' was not declared in this scope

     else SPCR &= ~(_BV(DORD));

          ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:10: note: suggested alternative: 'EECR'

     else SPCR &= ~(_BV(DORD));

          ^~~~

          EECR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:24: error: 'DORD' was not declared in this scope

     else SPCR &= ~(_BV(DORD));

                        ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:293:24: note: suggested alternative: 'DDRB'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setDataMode(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:298:5: error: 'SPCR' was not declared in this scope

     SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:298:5: note: suggested alternative: 'EECR'

     SPCR = (SPCR & ~SPI_MODE_MASK) | dataMode;

     ^~~~

     EECR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::setClockDivider(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:303:5: error: 'SPCR' was not declared in this scope

     SPCR = (SPCR & ~SPI_CLOCK_MASK) | (clockDiv & SPI_CLOCK_MASK);

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:303:5: note: suggested alternative: 'EECR'

     SPCR = (SPCR & ~SPI_CLOCK_MASK) | (clockDiv & SPI_CLOCK_MASK);

     ^~~~

     EECR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:304:5: error: 'SPSR' was not declared in this scope

     SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((clockDiv >> 2) & SPI_2XCLOCK_MASK);

     ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:304:5: note: suggested alternative: 'ACSR'

     SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((clockDiv >> 2) & SPI_2XCLOCK_MASK);

     ^~~~

     ACSR

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:42: error: 'SPCR' was not declared in this scope

   inline static void attachInterrupt() { SPCR |= _BV(SPIE); }

                                          ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:42: note: suggested alternative: 'EECR'

   inline static void attachInterrupt() { SPCR |= _BV(SPIE); }

                                          ^~~~

                                          EECR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:54: error: 'SPIE' was not declared in this scope

   inline static void attachInterrupt() { SPCR |= _BV(SPIE); }

                                                      ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:309:54: note: suggested alternative: 'ACIE'

In file included from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/utility/ATTiny/RF24_arch_config.h:26:0,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24_config.h:60,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24/RF24.h:18,

                 from C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\ATtiny85\NRF24L01 3 Pins\test2\test2.ino:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:42: error: 'SPCR' was not declared in this scope

   inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }

                                          ^~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:42: note: suggested alternative: 'EECR'

   inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }

                                          ^~~~

                                          EECR

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\PROPRI~1\AppData\Local\Temp\arduino_build_263541\sketch\test2.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:55: error: 'SPIE' was not declared in this scope

   inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }

                                                       ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:310:55: note: suggested alternative: 'ACIE'

Using library RF24 at version 1.4.0 in folder: C:\Users\Proprietaire\OneDrive - Agriculture Pangea\Documents\Arduino\libraries\RF24 

Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 

exit status 1

Error compiling for board ATtiny*5 Series.


Yes I follow this instructables example

OK

you probably did not install ATTinyCore which is the version you need in the board manager

see this note for ATTiny in the RF24 documentation

(il y a un forum en français si vous voulez)

Already done

Sans titre

already successful to compile simple code and upload to ATtiny85

This does not look like the same UI for board definition

seems you have installed this board manager and got the ATTiny package
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

and not ATTinyCore you get with http://drazzy.com/package_drazzy.com_index.json in preferences

1 Like

You got it :muscle:

Thanks for your help :star_struck: