inputting values to processing graph

hello
I want to make a weather station and display the values using this sketch,
the part that has a lot of = after it is the part that I think is relevant. though this sketch has no arduino code, that I will insert later but im not sure how to read the values from a dht22. I know how to set it up, I don't know how to turn it to a float (which is in the sketch below) and display it. im not sure if the dht22 value is a float, if not could I change it to something else?

thanks
simon

import org.gicentre.utils.stat.*;    // For chart classes.
 
// Displays a simple line chart representing a time series.
 
XYChart lineChart;
 
// Loads data into the chart and customises its appearance.
void setup()
{
  size(500,200);
  textFont(createFont("Arial",10),10);
 
  // Both x and y data set here.  ======================================
 lineChart = new XYChart(this);======================================
  lineChart.setData(new float[] {1900, 1910, 1920, 1930, 1940, 1950, ============                  
                                  1960, 1970, 1980, 1990, 2000},=========================
                    new float[] { 6322,  6489,  6401, 7657, 9649, 9767,    ===============                             
                                  12167, 15154, 18200, 23124, 28645});======================
   
  // Axis formatting and labels.
  lineChart.showXAxis(true); 
  lineChart.showYAxis(true); 
  lineChart.setMinY(0);
     
  lineChart.setYFormat("$###,###");  // Monetary value in $US
  lineChart.setXFormat("0000");      // Year
   
  // Symbol colours
  lineChart.setPointColour(color(180,50,50,100));
  lineChart.setPointSize(5);
  lineChart.setLineWidth(2);
}
 
// Draws the chart and a title.
void draw()
{
  background(255);
  textSize(9);
  lineChart.draw(15,15,width-30,height-30);
   
  // Draw a title over the top of the chart.
  fill(120);
  textSize(20);
  text("Income per person, United Kingdom", 70,30);
  textSize(11);
  text("Gross domestic product measured in inflation-corrected $US", 
        70,45);
}

this is the dht22 sketch which is the example that came with the library.
I will be sending this from one arduino to another via nrf24l01, which I haven't got working yet and think that I will have to use the int value instead of float as there is apparently a problem with the float and sprintf command????
again I have tried to highlight, not the nicest looking but not sure of any other way(suggestions for highlighting parts of sketch, cheers!)
thanks
:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

#include <DHT22.h>
// Only used for sprintf
#include <stdio.h>

// Data wire is plugged into port 7 on the Arduino
// Connect a 4.7K resistor between VCC and the data pin (strong pullup)
#define DHT22_PIN 7

// Setup a DHT22 instance
DHT22 myDHT22(DHT22_PIN);

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("DHT22 Library Demo");
}

void loop(void)
{ 
  DHT22_ERROR_t errorCode;
  
  // The sensor can only be read from every 1-2s, and requires a minimum
  // 2s warm-up after power-on.
  delay(2000);
  
  Serial.print("Requesting data...");
  errorCode = myDHT22.readData();
  switch(errorCode)
  {
    case DHT_ERROR_NONE:
      Serial.print("Got Data ");
      Serial.print(myDHT22.getTemperatureC());
      Serial.print("C ");
      Serial.print(myDHT22.getHumidity());
      Serial.println("%");
      // Alternately, with integer formatting which is clumsier but more compact to store and
	  // can be compared reliably for equality:
	  //	  
      char buf[128];=============================================================
      sprintf(buf, "Integer-only reading: Temperature %hi.%01hi C, Humidity %i.%01i %% RH",=======
                   myDHT22.getTemperatureCInt()/10, abs(myDHT22.getTemperatureCInt()%10),=======
                   myDHT22.getHumidityInt()/10, myDHT22.getHumidityInt()%10);=================
      Serial.println(buf);=========================================================
      break;==================================================================
    case DHT_ERROR_CHECKSUM:
      Serial.print("check sum error ");
      Serial.print(myDHT22.getTemperatureC());
      Serial.print("C ");
      Serial.print(myDHT22.getHumidity());
      Serial.println("%");
      break;
    case DHT_BUS_HUNG:
      Serial.println("BUS Hung ");
      break;
    case DHT_ERROR_NOT_PRESENT:
      Serial.println("Not Present ");
      break;
    case DHT_ERROR_ACK_TOO_LONG:
      Serial.println("ACK time out ");
      break;
    case DHT_ERROR_SYNC_TIMEOUT:
      Serial.println("Sync Timeout ");
      break;
    case DHT_ERROR_DATA_TIMEOUT:
      Serial.println("Data Timeout ");
      break;
    case DHT_ERROR_TOOQUICK:
      Serial.println("Polled to quick ");
      break;
  }
}