So in the GPIO utility from WiringPi there is a command to change the mode of the GPIO pins. There is input mode, output mode and PWM mode. What is the difference between output mode and PWM mode? Is output mode digital and PWM analog?
Input mode is for reading from the pin.
Output mode is for writing 0 or 1 to the pin.
PWM mode is for writing 0 and 1 to the pin in a rapid sequence. The pin will be cycled between on and off many time a second. For each cycle the pin will be on (1) for a time and then off (0) for a time. The proportion of time on for each cycle is called the dutycycle.
PWM output may be used to control the brightness of LEDs and the speed of motors. In effect you can think of PWM as digitally changing the voltage. Full on (100% dutycycle) give 3.3V at the pin. Full off (0% dutycycle) gives 0V at the pin and half on (50% dutycycle) gives 1.65V at the pin. This is a VERY SIMPLISTIC description. Research on line for a more accurate description.