Data transfer via nRF24L01 radio link

Hi
Please excuse my ignorance, I'm a noob...

I'm using the script below as a test to pass analog data from an UNO in my shed to an Uno in my house using two nRF24LOI radio modules.
This works fine and I can read the two analog levels on a serial monitor in the house.

What I want to do is to use these two levels to do meaningful stuff with ie. set an alarm off when levels get too high and similar other tasks.
I know how to do stuff with integers but I can't get my head round how I turn the received data packets into integers for further processing.
Are they strings that are being sent?.....bit confused over this.

Anyhoo, hope that makes sense and I would be gratefull for some pointers.
Here is the receive part of the script and as I say, the serial monitor is showing the two columns of "shed" analog data perfectely...

Thank you
Phil

/* YourDuinoStarter Example: nRF24L01 Receive Joystick values

 - WHAT IT DOES: Receives data from another transceiver with
   2 Analog values from a Joystick or 2 Potentiometers
   Displays received values on Serial Monitor
 - SEE the comments after "//" on each line below
 - CONNECTIONS: nRF24L01 Modules See:
 http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
   1 - GND
   2 - VCC 3.3V !!! NOT 5V
   3 - CE to Arduino pin 9
   4 - CSN to Arduino pin 10
   5 - SCK to Arduino pin 13
   6 - MOSI to Arduino pin 11
   7 - MISO to Arduino pin 12
   8 - UNUSED
   
 - V1.00 11/26/13
   Based on examples at http://www.bajdi.com/
   Questions: terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
/*-----( Declare Constants and Pin Numbers )-----*/
#define CE_PIN   9
#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t pipe = 0xE8E8F0F0E1LL; // Define the transmit pipe


/*-----( Declare objects )-----*/
RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
/*-----( Declare Variables )-----*/
int joystick[2];  // 2 element array holding Joystick readings

void setup()   /****** SETUP: RUNS ONCE ******/
{
  Serial.begin(9600);
  delay(1000);
  Serial.println("Nrf24L01 Receiver Starting");
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();;
}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
  //delay(50);
  if ( radio.available() )
  {
    // Read the data payload until we've received everything
    bool done = false;
    while (!done)
    {
      // Fetch the data payload
      done = radio.read( joystick, sizeof(joystick) );
      Serial.print("X = ");
      Serial.print(joystick[0]);
      Serial.print(" Y = ");      
      Serial.println(joystick[1]);
    }
  }
  else
  {    
      Serial.println("No radio available");
  }

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/

//NONE
//*********( THE END )***********

The received data is being stored in the joystick array which is defined as containing ints. You print joystick[0] which contains the X value and joystick[1] which contains the Y value. They are both already integers and you can compare either of them with other integers. What have you tried so far ?

Hi
Thanks for the response....
Not tried anything yet as I couldn't decide what the intergers were..
Need to do a lot more reading...

So, is "joystick[0]" an integer then?

Phil

So, is "joystick[0]" an integer then?

Yes, and so is joystick[1] because of

int joystick[2];  // 2 element array holding Joystick readings

Great stuff...
I haven't had any dealings with arrays yet as I'm new to Arduino so will go and read up
on them this evening.

Thank you so much for the help

Phil

Yay!
Sorted....
Read up on arrays which is what was confusing me before...

Declared a float and passed the value of joystick[0] to that float.
Did a calculation on it... *5.0/1023 and I'm now printing out the actual
voltage (0 to 5volts) from the analog port input...

So, I can now do stuff with the received values...

Many thanks again for pointing this old noob in the right direction...

Phil

Good news !