pwmVal = map(pulseWidth, 1000, 2000, 0, 255);
Thank you very much for your reply.That helped a lot. One more question? Do we need a separate power supply? Actually i didnt want to make my assembly heavy with extra power source.I need it to fly of the ground.Is there any way to use common power supply.