I want to send multiple data between 2 arduinos and i get only 0 on output pls help. I connected everything as it should be input is from joystick. When I use TransferTimeout example it transfers with no problems.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
Problem in my situation is that I need to send variables. I sucessfully transfered text by myself before but i dont know how to send variables by using structure.
struct TYPENAME { struct members }; //This is right
struct { struct members } VARIABLENAME; //This is wrong
You should also make sure that the size of the payload matches the size of the message with "radio.setPayloadSize(sizeof(TYPENAME))".
Even though it not causes a problem, you should set pinMode for the analog pins before reading from them. I would also make some Serial.prints for the "joy" variable on the transmitter end to be sure that the analog reads actually produces values other than zero.
UKHeliBob:
Whilst it does not define a type is it really wrong ?
If OP wants to use the struct as a type, which it seems like due to the "typedef" and the "joystick joy;" declarations, then I would consider it wrong. If the struct is only to be used as a single instance variable, then it is not wrong.
You can only send 32 bytes of data in one message, but you can send larger amounts of data in multiple messages / chunks. You should ask yourself wheter you need to send any text at all? You could send a "text_id" identifying the text which is known to both ends..