Question: o what is the difference between digital and analog arduino ports?
Answer: The Arduino can input and output analog signals as well as digital signals. An analog signal is one that can take on any number of values, unlike a digital signal which has only two values: HIGH and LOW. ... The function used to output a PWM signal is analogWrite(pin, value). pin is the pin number used for the PWM output.