Thank you so much, Ray, for your reply.
Yes, the Atmega328 is using the 28 pin DIP package.
Kindly refer to the rough diagram I have drawn. Sorry if it's a bit messy.
Here's the code:
#include "DHT.h"
#include <LiquidCrystal.h>
#define DHTPIN A2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(A0, A1, 9, 10, 11, 12);
void setup()
lcd.begin(16, 2);
dht.begin();
}
void loop()
{
int h = dht.readHumidity();
int t = dht.readTemperature();
lcd.setCursor(0,0);
lcd.print("Temp=");
lcd.print(t);
lcd.print(" *C");
lcd.setCursor(0,1);
lcd.print("Humidity=");
lcd.print(h);
lcd.print("% ");
delay(1500);
}