It doesn't matter where in the sentence the pronoun comes it always follows the same rules. If the pronoun corresponds with the subject (the one carrying out the act) use I. If it corresponds with the object (the one that is the receiver of the act) use me.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.