Raspberry Pi / Arduino Motor Control

Then ive connected one gpio from the pi to a digital input pin on my arduino with an led in between.

What is the LED for? Do you have a current limiting resistor, too?