Hello every one,
I'm trying to use the RF24 library on Arduino Nano V3 with NRF23L01
But after the instruction "radio.begin()" i just can't manage the ledPin (13)
If someone could help me please ! I dont understand why the RF24 library to avoid to use the ledPin !
HELP PLEASE !!
Here is the code :
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00006";
const int ledPin = 13;
char text[32] = "";
String data="Ouverture";
int ledState=LOW;
void setup() {
Serial.begin(9600);
//Initialisation Radio
radio.begin(); // ATTENTION CETTE INSTRUCTION DESACTIVE LA LED
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
//Initialisation Led
pinMode(ledPin,OUTPUT);
digitalWrite(ledPin, HIGH);
}
void loop() {
//Lecture de la data
if (radio.available()) {
radio.read(&text, sizeof(text));
Serial.println(text);
}
data = String(text);
//Verification du message
if(data.equals("Ouverture")) // A VERIFIER
{
digitalWrite(ledPin, HIGH);
Serial.println("UP");
}
else if (data.equals("Fermeture"))
{
digitalWrite(ledPin, HIGH);
Serial.println("DOWN");
}
else
{
//CLIGNOT
}
}