Hello,
I am a Newbie to arduino can anyone suggest me how can i send analog values from the Thumb Joystick using analogRead() function and send wirelessly using RF transmitter using VitualWire library
Check out this page:
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
I believe the example code is exactly what you are looking for.
how can i send analog values from the Thumb Joystick using analogRead() function and send wirelessly using RF transmitter using VitualWire library
The code referenced by jthefreak uses different libraries, but the model is good. The send and receive syntax will be different for VW, but you will define an array like int sendJoystick[2] for the X and Y values of analog read.
The send command will be
vw.send((uint8_t*) &sendJoystick, sizeof(sendJoystick));
The cast (uint8_t*) breaks the data in the array into bytes for transmission. The & ("address of") makes it work on sendJoystick[].
On the receiving end you will declare another array like int receiveJoystick[2] to hold the received data.
In the VW receive example sketch you will see code like this
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
In the code block following the if you will use
memcpy(&receiveJoystick, buf, buflen);
This copies the received bytes in the buffer into the receiveJoystick[] array where they will be recombined into integers for your further use.
The use of the (uint8_t*) cast for the transmission and memcpy on the receiving is a useful template for sending all kinds of data in arrays, unions, structures, etc.
Depending on how you want to use the data, you will need to control the transmission with either the built in joystick select button or on a timed basis.