need help for letting my program work on the Mega

Several of the devices use the hardware SPI interface. On the Mega the SPI pins are 50-53 instead of 10-13.

UNO Mega
Default SS 10 53
MOSI 11 50
MISO 12 51
SCK 13 52

You will probably have to at least cut pins 11, 12, and 13 and jumper those to 50, 51, and 52 respectively. Set pinMode(53, OUTPUT). That may be enough if the library you use doesn't play special tricks when it is compiled for the Mega.