speed controller

I want to connect my arduino mega to a rc speed controller , to controll the motor its attached to , but it has a connection to a rc battery and when it is hooked up to a standard reciever it powers it, will it overload my mega? , do i even need to even hook up the ground and power to the mega ?
its a xl 5 esc traxxas

I want to connect my arduino mega to a rc speed controller , to controll the motor its attached to , but it has a connection to a rc battery and when it is hooked up to a standard reciever it powers it, will it overload my mega? , do i even need to even hook up the ground and power to the mega ? its a xl 5 esc traxxas

Assuming your Mega is already powered you only require two wires to the speed controller (which is emulating a standard servo interface) ground to ground and the mega digital output pin to servo input control pin on the controller you are using.

code wise, how do i control the motor?

Just like you would control a servo. Use the servo library.