I am programming a RaspberryPi Pico with the Arduino IDE. Works pretty well, but now I try to control an nrf24l01 module.
My code compiles but I do not know on which pins the SPI bus has to be hocked up. I tried to connect to different pins according the pinout https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf (for example 2 sck, 3 miso, 4 mosi), but nothing worked so far.
Does anybody know what the default pins are or how to control them? I also would like to control other SPI hardware, for example a display.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
const uint64_t address = 0x1;
byte sendData[1];
#define CSN_PIN 5
#define CE_PIN 6
RF24 radio(CE_PIN, CSN_PIN);
byte counter = 0;
void setup()
{
Serial.begin(115200);
Serial.println(“radio starting");
if (!radio.begin())
{
Serial.println("radio hardware is not responding!!");
while (1) {}
}
radio.openWritingPipe(address);
}
void loop()
{
Serial.print("Counter: ");
Serial.println(counter);
sendData[0] = counter;
radio.write( sendData, sizeof(sendData));
counter++;
}