Need basic code to run a motor

Part of the problem is that the library won't send the data until you call Wire.endTransmission().

What motor control hardware is between the Arduino and the motor? Without knowing what the I2C device it it will be very hard to guess how to control it.