NRF24l01 problem

Hi,

I have spent a lot of time programing the NRF code for my end project in high school but I, don’t know why, can’t do it.
My project contains two NRF moduls. One is in the motorbike and one is in the backpack. When I turn on the blinker the LEDs on backpack nedds to blink, and when I break, the breaking light should turn on.

I have writen the code for transmitting the signals by wire, but it will be better to transmitte the signal by wireless comunication.

I used three analog inputs and three digital outputs and the program with wires is working well.

I found this two programs on internet for the project, but one (FHQIN%T…TG.ino) is not working it has a error.

Is it possible to help me?

Thank you for your answer.

Matej M.

FHQIN5TIIYZ09TG.ino (3.88 KB)

FECHBQ8IDPSCJQU.ino (1.13 KB)

Please do this:

  • When you encounter an error, you’ll see a button on the right side of the orange bar “Copy error messages” in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button…
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum’s 9000 character limit, save it to a .txt file and post it as an attachment. If you click the “Reply” button here, you will see an “Attachments and other settings” link that will allow you to make the attachment.

In your receiver program you have

    done = radio.read(input, sizeof(input));

which is where the error occurs.

The read() function does not return a value, rather it populates the data item directly, hence the error
Change the line to

    radio.read(input, sizeof(input));

Take a look at Simple nRF24L01+ 2.4GHz transceiver demo for examples of Tx and Rx

@UKHeliBob thank you for your time and help i will try your sugestion.

Matej