9 responses to “Sending structs with nRF24L01 modules and the RF24 library”

  1. Robo


    What if you would like to send the analog values from potentiometer to another arduino? Do you have to do it using float? I’m struggling to send the values and provide it to the servo.


  2. Vaclav

    thanks for the idea. I’m trying to make this work between Arduino and Raspberry Pi (with RF24 ported). The data send from Arduino to Raspberry gets through ok, but vice versa I have some issues with the struct contruct. It seems like some of the struct data gets mixed up.

    Anyway, I came back to this post to see if I didn’t miss anything important. Rereading the source, I don’t understand, why you created two structs – the A_t and the B_t. Wouldn’t just one type be enough? Then of course make two variables duino1 and duino2, but both of the same one type?

  3. pater

    @Vaclav, remember that representation of some variable types like float can be represented differently in memory on arduino and raspberry pi so it’s better to send them like integers (multiple by 100 for example)

  4. Mauro

    Many thank’s for the example… after many days of research and test with different sketch found on other page without results I found yours…..

    Now I’m able to send wireless from one arduino to the other data like temperature, pressure, UV etc.


    1. ddea


      I’m also working on getting my RPi Setup to recieve data structs, sending them from my arduino setup is easy thanks to this blog.

      Can anyone help with getting the RPi code working using https://github.com/stanleyseow/RF24 Fork?



  5. sevkisahin

    Hi, i have a question about nrf24l01. So, i want to sending measured gas ratio,temp.,humidity,day,month,..,clock information. And i tried some library but i didn’t get result yet. How to edit your code for my request ? Can you help me for this ?
    Thanks. Success in your works.
    Greetings from Turkey.


    thank you sooooooo much.

Leave a Reply