help me to convert my program for uno to arduino mega2560

HI FRIENDS,
I HAVE THIS PROGRAM WORKING ON ARDUINO UNO BUT NOT WORKING ON ARDUINO MEGA2560 SO PLEASE HELP ME AND GIVE ME PIN MAPPING FOR ARDUINO MEGA2560

#include <SoftwareSerial.h>
#define SSID “sumeru” //put your SSID
#define PASS “test12345” //put your password

#define CH1 2
#define CH2 3
#define CH3 4
#define CH4 5
#define CH5 5
#define CH6 7
#define CH7 8
#define CH8 9

char temp[20];
int o;
SoftwareSerial dbgSerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
dbgSerial.begin(9600);
dbgSerial.setTimeout(5000);
pinMode(CH1,OUTPUT);
pinMode(CH2,OUTPUT);
pinMode(CH3,OUTPUT);
pinMode(CH4,OUTPUT);
pinMode(CH5,OUTPUT);
pinMode(CH6,OUTPUT);
pinMode(CH7,OUTPUT);
pinMode(CH8,OUTPUT);

Serial.println(“ESP8266 Demo”);
//test if the module is ready
dbgSerial.println(“AT+RST”);
delay(1000);
if (dbgSerial.find(“ready”))
{
Serial.println(“Module is ready”);
}
else
{
Serial.println(“Module have no response.”);
while (1);
}
delay(1000);
//connect to the wifi
boolean connected = false;
for (int i = 0; i < 5; i++)
{
if (connectWiFi())
{
connected = true;
break;
}
}
if (!connected) {
while (1);
}
delay(5000);

//set the single connection mode
dbgSerial.println(“AT+CIPMUX=1”);
delay(1000);
dbgSerial.println(“AT+CIPSERVER=1,9999”);
while(!(dbgSerial.available()));
while(dbgSerial.available())
Serial.write(dbgSerial.read());
// print the ip addr
dbgSerial.println(“AT+CIFSR”);
Serial.println(“ip address:”);
while (dbgSerial.available())
Serial.write(dbgSerial.read());
delay(1000);
}
void loop()
{
o=0;
while(!dbgSerial.available());
while (dbgSerial.available())
{
// Serial.write(dbgSerial.read());
temp[o++] = dbgSerial.read();
delay(15);

}
// Serial.println(temp);
temp[o] = ‘\0’;
for(o=0;temp[o] !=’:’;o++);
o++;
char v = temp[o];
switch (v)
{
case ‘N’:
o++;
if(temp[o] == ‘1’)
{
Serial.println(“ON one…”);
digitalWrite(CH1,HIGH);
}
else if(temp[o] == ‘2’)
{
Serial.println(“ON two…”);
digitalWrite(CH2,HIGH);
}
else if(temp[o] == ‘3’)
{
Serial.println(“ON three…”);
digitalWrite(CH3,HIGH);
}
else if(temp[o] == ‘4’)
{
Serial.println(“ON four…”);
digitalWrite(CH4,HIGH);
}
else if(temp[o] == ‘5’)
{
Serial.println(“ON five…”);
digitalWrite(CH5,HIGH);
}
else if(temp[o] == ‘6’)
{
Serial.println(“ON six…”);
digitalWrite(CH6,HIGH);
}
else if(temp[o] == ‘7’)
{
Serial.println(“ON seven…”);
digitalWrite(CH7,HIGH);
}
else if(temp[o] == ‘8’)
{
Serial.println(“ON eight…”);
digitalWrite(CH8,HIGH);
}
else if(temp[o] == ‘A’)
{
Serial.println(“ON ALL…”);
digitalWrite(CH1,HIGH);
digitalWrite(CH2,HIGH);
digitalWrite(CH3,HIGH);
digitalWrite(CH4,HIGH);
digitalWrite(CH5,HIGH);
digitalWrite(CH6,HIGH);
digitalWrite(CH7,HIGH);
digitalWrite(CH8,HIGH);
}
break;
case ‘F’:
o++;
if(temp[o] == ‘1’)
{
Serial.println(“OFF one…”);
digitalWrite(CH1,LOW);
}
else if(temp[o] == ‘2’)
{
Serial.println(“OFF two…”);
digitalWrite(CH2,LOW);
}
else if(temp[o] == ‘3’)
{
Serial.println(“OFF three…”);
digitalWrite(CH3,LOW);
}
else if(temp[o] == ‘4’)
{
Serial.println(“OFF four…”);
digitalWrite(CH4,LOW);
}
else if(temp[o] == ‘5’)
{
Serial.println(“OFF five…”);
digitalWrite(CH5,LOW);
}
else if(temp[o] == ‘6’)
{
Serial.println(“OFF six…”);
digitalWrite(CH6,LOW);
}
else if(temp[o] == ‘7’)
{
Serial.println(“OFF seven…”);
digitalWrite(CH7,LOW);
}
else if(temp[o] == ‘8’)
{
Serial.println(“OFF eight…”);
digitalWrite(CH8,LOW);
}
else if(temp[o] == ‘A’)
{
Serial.println(“ON ALL…”);
digitalWrite(CH1,LOW);
digitalWrite(CH2,LOW);
digitalWrite(CH3,LOW);
digitalWrite(CH4,LOW);
digitalWrite(CH5,LOW);
digitalWrite(CH6,LOW);
digitalWrite(CH7,LOW);
digitalWrite(CH8,LOW);
}
break;
}
}
boolean connectWiFi()
{
dbgSerial.println(“AT+CWMODE=1”);
String cmd = “AT+CWJAP=”";
cmd += SSID;
cmd += “”,"";
cmd += PASS;
cmd += “”";
Serial.println(cmd);
dbgSerial.println(cmd);
delay(2000);
if (dbgSerial.find(“OK”))
{
Serial.println(“OK, Connected to WiFi.”);
return true;
}
else
{
Serial.println(“Can not connect to the WiFi.”);
return false;
}
}

Please have a look at this thread: How To Use This Forum and pay particular attention to item 7. The code you have posted is unreadable for me, it is full of funny symbols and obviously misformatted.

I HAVE THIS PROGRAM WORKING ON ARDUINO UNO BUT NOT WORKING ON ARDUINO MEGA2560 SO PLEASE HELP ME AND GIVE ME PIN MAPPING FOR ARDUINO MEGA2560

STOP SCREAMING!

The pins are all the same, except for the SPI pins, which YOU can look up. What is NOT needed is to use SfoftwareSerial on a device with 4 hardware serial ports.

If your shield does not connect using the ICSP pins, toss it and get one that does.

The code does something. You have not explained what it actually does. You expect it to do something. You have not explained what you expect.

In answer to another ESP8266 query I successfully connected mine to the ICSP pins which are common on Uno and Mega.

...R

how to use ICSP PINS

sajeed: how to use ICSP PINS

The ICSP pins just duplicate the same function on the regular Arduino pins - but they are always in the same place on every Arduino board whereas (for example) MOSI may be on different "regular" pins on different boards.

Just connect to the relevant ICSP pin instead of the "regular" pin.

...R