1. A method of controlling gastrointestinal motility comprising: delivering a first electrical pattern to gastrointestinal tract electrodes to cause a muscle of the gastrointestinal tract to relax after a prolonged controlled contraction; and delivering a second electrical pattern to the gastrointestinal tract electrodes to cause a desired response of the gastrointestinal tract.