nRF24 / RF24

OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
https://nrf24.github.io/RF24
GNU General Public License v2.0
2.23k stars 1.02k forks source link

Does not compile against standard SPI library, using DUE #52

Closed NeoTokyoNori closed 9 years ago

NeoTokyoNori commented 9 years ago

Hello, Thanks for making this library, first of all. It looks promising and I am eager to get it working.

I have been using Greg copelands library up till now on Uno, Mini etc. I just got my new DUE today, and would like to use your library with it, but I am getting various compile errors which suggest it does not like the SPI library, e.g.

Arduino: 1.5.8 (Windows 8), Board: "Arduino Due (Programming Port)" In file included from PRX_SORTER_33.ino:162:0: \Documents\Arduino\libraries\SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)': \Documents\Arduino\libraries\SPI/SPI.h:56:3: error: 'SPDR' was not declared in this scope SPDR = _data; ^ \Documents\Arduino\libraries\SPI/SPI.h:57:12: error: 'SPSR' was not declared in this scope while (!(SPSR & _BV(SPIF))) ^ \Documents\Arduino\libraries\SPI/SPI.h:57:23: error: 'SPIF' was not declared in this scope while (!(SPSR & _BV(SPIF)))

I have not been able to find any fixes on the arduino forum, so your help would be welcomed.

TMRh20 commented 9 years ago

See:

http://stackoverflow.com/questions/16752806/how-do-i-remove-a-library-from-the-arduino-environment

http://arduino.cc/en/Guide/Libraries

NeoTokyoNori commented 9 years ago

Hi, that is the way I have been replacing my libraries, by moving/removing files from \Documents\Arduino\libraries\ I also restart the IDE, so I guess that Is not the issue here.

I have obviously replaced the RF24 library, but is there something I need to do to the SPI library?

On a side note, I tried uploading the same code to my UNO, which I have been using up till now, but it is also giving compile errors, such as the following.

RF24\RF24.cpp.o: In function RF24::read_register(unsigned char, unsigned char*, unsigned char)': C:\Users\NORIHIRO-01\Documents\Arduino\libraries\RF24/RF24.cpp:101: undefined reference toSPIClass::transfer(unsigned char)' C:\Users\NORIHIRO-01\Documents\Arduino\libraries\RF24/RF24.cpp:103: undefined reference to `SPIClass::transfer(unsigned char)'

TMRh20 commented 9 years ago

https://www.google.com/search?q=troubleshooting+arduino+library&ie=utf-8&oe=utf-8

http://arduino.cc/en/guide/troubleshooting

http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_software_question

NeoTokyoNori commented 9 years ago

Well I guess I have to do more digging...

Just to make sure, does your library work with DUE and the standard SPI library?

TMRh20 commented 9 years ago

http://tmrh20.github.io/RF24/