I added some new figures and adjusted some text about how to drive actuators and how to connect sensors. What is Pulse Width Modulation (PWM) and how does this relate to ‘AnalogWrite’ in your code? How can you make a LED light up when the terminal output is zero?
Take a look here.