adding another DHT22 to my Data Logger?

Hey all,
I’ve recently completed my first arduino project, and it seems to be working great so far, (aside from the occasional random ‘nan’ readings.)

To test myself, I wanted to see what it would take to add a 2nd sensor to the project, and although I found some similar projects trying to add anywhere from one more sensor to wanting 6 sensors, honestly things weren’t quite clear to me, as I’m still a baby when it comes to this whole arduino thing… But i’m learning!

Here’s the code I’m running. I’ve still got ports 1 through 7 open, by looking at the first sensor, I’m guessing I don’t want a PWM port, right? or does it matter? (still have to look further into PWM to learn more

#include <SD.h>
#include <SPI.h>
#include “DHT.h”

#define DHTPIN 8
#define DHTTYPE DHT22

long seconds = 00;
long minutes = 00;
long hours = 00;

int CS_pin = 10;

DHT dht(DHTPIN, DHTTYPE);
File sd_file;

void setup() {
Serial.begin(9600);
pinMode(CS_pin, OUTPUT);
dht.begin();
// SD Card Initialization
if (SD.begin()) {
Serial.println(“SD card is initialized. Ready to go”);
}
else {
Serial.println(“Failed”);
return;
}

sd_file = SD.open(“data.txt”, FILE_WRITE);

if (sd_file) {
Serial.print(“Time”);
Serial.print(",");
Serial.print(“Humidity”);
Serial.print(",");
Serial.print(“Temperature_C”);
Serial.print(",");
Serial.print(“Temperature_F”);
Serial.print(",");
Serial.println(“Heat_index”);

sd_file.print(“Time”);
sd_file.print(",");
sd_file.print(“Humidity”);
sd_file.print(",");
sd_file.print(“Temperature_C”);
sd_file.print(",");
sd_file.print(“Temperature_F”);
sd_file.print(",");
sd_file.println(“Heat_index”);
}
sd_file.close(); //closing the file
}

void loop() {
sd_file = SD.open(“data.txt”, FILE_WRITE);
if (sd_file) {
senddata();
}
// if the file didn’t open, print an error:
else {
Serial.println(“error opening file”);
}
delay(1000);
}

void senddata() {
for (long seconds = 00; seconds < 60; seconds = seconds + 2) {
float temp = dht.readTemperature(); //Reading the temperature as Celsius and storing in temp
float hum = dht.readHumidity(); //Reading the humidity and storing in hum
float fah = dht.readTemperature(true);
float heat_index = dht.computeHeatIndex(fah, hum);

sd_file.print(hours);
sd_file.print(":");
sd_file.print(minutes);
sd_file.print(":");
sd_file.print(seconds);
sd_file.print(", “);
sd_file.print(hum);
sd_file.print(”, “);
sd_file.print(temp);
sd_file.print(”, “);
sd_file.print(fah);
sd_file.print(”, ");
sd_file.println(heat_index);

Serial.print(hours);
Serial.print(":");
Serial.print(minutes);
Serial.print(":");
Serial.print(seconds);
Serial.print(", “);
Serial.print(hum);
Serial.print(”, “);
Serial.print(temp);
Serial.print(”, “);
Serial.print(fah);
Serial.print(”, ");
Serial.println(heat_index);

if (seconds >= 58) {
minutes = minutes + 1;
}

if (minutes > 59) {
hours = hours + 1;
minutes = 0;
}

sd_file.flush(); //saving the file

delay(2000);
}
sd_file.close(); //closing the file
}

if anyone could help me add the second sensor, I’d appreciate it!

also, to extend the period of time between readings from 2 seconds to 5 seconds, would I change this:

sd_file.flush(); //saving the file

delay(2000);
}
sd_file.close(); //closing the file

to this:

sd_file.flush(); //saving the file

delay(5000);
}
sd_file.close(); //closing the file

?