Compilation [Solved]

Why do I have these errors when I try to compile the enclosed attachment shown below?.
The compilation stops with this error:

‘Mirf’ was not declared in this scope

and this in the compiler window:

attiny84_mirf.ino:26:19: warning: SPI85.h: No such file or directory
attiny84_mirf.ino:27:18: warning: Mirf.h: No such file or directory
attiny84_mirf.ino:28:37: warning: MirfHardwareSpi85Driver.h: No such file or directory
In file included from C:\Users\End User\Documents\Arduino\hardware\tiny\cores\tiny/Stream.h:24,
from C:\Users\End User\Documents\Arduino\hardware\tiny\cores\tiny/TinyDebugSerial.h:31,
from attiny84_mirf.ino:29:

When this program is loaded and all the files are in the same folder that are required by the sketch. I can see them and read/modify them all from the tabs in the sketch.


This is an attiny84 example code for the nRF24L01 that can communicate with RF24 library

All the support files and libraries for the attiny85 for nRF24L01 is at repo listed  below

 *  repo   :
 *  Author : Stanley Seow
 *  e-mail :
 *  date   : 8 Aug 2013
 Some default values to take note when using this mirf/spi85 library
 Uses Mirf forked library from
 - node addressing is similar to RF24 libs but the bytes are flipped 
   byte TADDR[] = {0xe3, 0xf0, 0xf0, 0xf0, 0xf0}; will matches receiver node of RF24 below 
   const uint64_t pipes[2] = { 0x7365727631LL, 0xF0F0F0F0E3LL };
 The repo for the RF24 lib is at

 Added TinyDebugSerial to the codes for TX only serial debugging

#include <SPI85.h>
#include <Mirf.h>
#include <MirfHardwareSpi85Driver.h>
#include <TinyDebugSerial.h>
TinyDebugSerial mySerial = TinyDebugSerial(); // PB0 on attiny84

// This USI-SPI was defined in SPI85.h
//#define MOSI  5
//#define MISO  4
//#define SCK   6

#define CE    7    
#define CSN   3 

//                           +-\/-+
//                     VCC  1|    |14  GND
//  SerialTx   (D  0)  PB0  2|    |13  AREF (D 10)
//             (D  1)  PB1  3|    |12  PA1  (D  9) 
//  RESET              PB3  4|    |11  PA2  (D  8) 
//  PWM  INT0  (D  2)  PB2  5|    |10  PA3  (D  7)  CE
//  SS/CSN     (D  3)  PA7  6|    |9   PA4  (D  6)  SCK
//  MISO       (D  4)  PA6  7|    |8   PA5  (D  5)  MOSI
//                           +----+

int bufferSize = 0;
char buffer[32] = "";
unsigned int counter = 0; 
uint8_t nodeID = 0;

void setup(){
  mySerial.begin( 9600 );    // for tiny_debug_serial 
  Mirf.cePin = CE;
  Mirf.csnPin = CSN;
  Mirf.spi = &MirfHardwareSpi85;

  // This address is compatible with my example of rpi-hub or nRF24_Arduino_as_hub
  // at repo 
  byte RADDR[] = {0xe7, 0xde, 0xde, 0xde, 0xde};
  byte TADDR[] = {0xe9, 0xde, 0xde, 0xde, 0xde};
  // Get nodeID from TXADDR 
  nodeID = *TADDR & 0xff; 
  // Compatible with RF24
  Mirf.baseConfig = _BV(EN_CRC) | _BV(CRCO);
  // 00 - 1Mbps
  // 01 - 2Mbps
  // 10 - 250Kbps
  // 11 - Reserved
  // 1<<2 & 1<<1 is for Max RF Power
  Mirf.configRegister( RF_SETUP,( 1<<RF_DR_LOW | 0<<RF_DR_HIGH ) | 1<<2 | 1<<1 ); = 0x55; // Same as rpi-hub and sendto_hub ( channel 85 )
  // Enable dynamic payload on the other side
  Mirf.configRegister( FEATURE, 1<<EN_DPL ); 
  Mirf.configRegister( DYNPD, 1<<DPL_P0 | 1<<DPL_P1 | 1<<DPL_P2 | 1<<DPL_P3 | 1<<DPL_P4 | 1<<DPL_P5 ); 
  // Print out register readinds for important settings
  uint8_t rf_ch, rf_setup = 0;
  byte tx_addr[5];
  byte rx_addr[5];
  Mirf.readRegister(RF_CH, &rf_ch,sizeof(rf_ch));
  Mirf.readRegister(RF_SETUP, &rf_setup, sizeof(rf_setup));
  Mirf.readRegister(TX_ADDR, tx_addr, sizeof(tx_addr));
  Mirf.readRegister(RX_ADDR_P1, rx_addr, sizeof(rx_addr));
  mySerial.print("RF_CH :0x");
  mySerial.print("RF_SETUP :0x");
  mySerial.print("TX_ADDR :");
  for ( int i=0;i<5;i++ ) {  // Loop 5 times, print in HEX
  mySerial.print( tx_addr[i], HEX);
  mySerial.print("RX_ADDR :");
  for ( int i=0;i<5;i++ ) {  // Loop 5 times, print in HEX
  mySerial.print( rx_addr[i], HEX);
  delay(1000);      // For serial debug to read the init config output

void loop(){
  uint8_t sent = false;
  unsigned long timer1;

  timer1 = millis();

  Mirf.payload = strlen(buffer);

  mySerial.print("Len :");
  mySerial.print(" Buffer :");  
  Mirf.send((byte *) buffer);
  while( Mirf.isSending() )
    sent = true; // Sent success
  if (sent) {   
        mySerial.print("Sent :");
    } else {       // <------- Else What?. Doc...
} // End loop()

I have the very same problems If I try to do it in the “normal” manner too.
I don’t understand a “File Not Found” error when I can read the “file” in the IDE.
I’ve attached the complete Zip from Github to this post.
What have I done wrong?. Is it possible that it’s an administrator permissions error in Windows 7 Ult 64 bit. I am administrator and I have no issues but I tried to modify one of the header files and got a permission error about write protected, save in another location… I’ve done this before with no issues and I don’t understand nor have a clue about where to even start with Mr Google, My good friend…


arduino-nrf24l01-master (2).zip (19.2 KB)

#include <Mirf.h>


#include "Mirf.h"

Are not the same thing. One looks in the libraries directory. The other looks in the sketch directory. You need to use the correct set when you put the libraries in the wrong place.

Binary sketch size: 4,770 bytes (of a 8,192 byte maximum)

Estimated used SRAM memory: 200 bytes Hint: You can set the maximum SRAM memory of your board directly in the boards.txt file

Thank You.. Paul S. I was aware of that but didn't change it because I could read the files in the IDE, each in it's tab... That was what threw me off, I couldn't understand an error from a loaded file. However it compiles now. Again, Thank You, Sir.



To prevent any library conflict, pls remove all the old SPI85 and mirf85 libraries and use the updated mirf libraries ( that also support SPI/USI ) instead of using two separate mirf libraries...

I'll removed the Mirf85 libs once all my URL are moved to the updated Mirf libs... ( too confusing to keep/maintain two Mirf libs... )

I removed all but your code and got the 84 example to compile... Finally The libraries are under C:\Users\End User\My Documents\Arduino\libraries\ATtiny_nRF24l01\mirf and \SPI and I moved the examples to a folder in the sketch folder. What I really need to know is how to set the 84 'fuses' 1 MHz internal, 8 MHz internal or 16 MHz External crystal?