Need Help With PID code - Motor Driver

No. analogWrite() only takes values from 0 to 255.

That is what SetMotorDirectionLower() and SetMotorDirectionHigher() are for. Write those two functions to set the motor direction.

And don't leave out the part about myPID.setOutputLimits().