https://www.fypsolutions.com/examples/how-to-control-your-dc-motor-using-arduino/