dparson55 / NRFLite

nRF24L01+ library with AVR 2 pin support, requiring very little code along with YouTube videos showing all available features.
MIT License
161 stars 27 forks source link

Added ESP32 support #46

Closed bart closed 4 years ago

bart commented 4 years ago

Set different SPI pins for ESP32 boards

bart commented 4 years ago

FYI: Added SPI pin mapping for TTGO ESP32 T8 v1.7 board which does not have default ESP32 SPI pins. Maybe we should add a method instead to set SPI pins during init?

Default ESP32 (V)SPI pinout is:

MOSI = 23 MISO = 19 CLK = 18 CS = 5

dparson55 commented 4 years ago

Thanks for helping to add ESP32 support and the idea to allow configuration of the SPI pins. I don't have one of these microcontrollers so can you see if the commit I made to your fork works? I removed the changes you made to init and instead added initEsp32.

bart commented 4 years ago

Wow, thanks for your quick implementation! Really love your library and for sure trying to improve it as good as I can by keeping it as simple as possible, too. Tested it on ESP32 (TTGO brand) using new initEsp32() method and after adding missing semicolon in NRFLite.h it works well. Well done!

dparson55 commented 4 years ago

Sure thing and I'm grateful for the help and good ideas on keeping the library simple. I made another change allowing init to handle the situation where the SPI library supports configurable pins. I added a `Basic_RX_ESP32' example. Does this work ok?

bart commented 4 years ago

Works very good sir, thank you so much. Removed TTGO brand name from example because your example pin mapping is for default ESP32 boards (which is better than TTGO). I think it's ready to merge now.

dparson55 commented 4 years ago

Awesome, thanks again!