Forum 2005-2010 (read only)
Syntax & Programs
(Read 748 times)
Dec 09, 2009, 04:39 pm
Just a weird questions
When using PWM you use the analogwrite command. Anyone know why they chose analogwrite, because technically PWM is still digital. It's just turning on and off really fast.
Dec 09, 2009, 05:00 pm
From a high level perspective, does it not appear to you that you are actually controlling the analog voltage output on that pin?
To your mother (who I presume won't understand this stuff), analogWrite appears to simply write an analog voltage on that pin. She doesn't know what PWM is and she doesn't even care.
Dec 09, 2009, 05:30 pm
If you filter the PWM signal with a capacitor you will get an analog value.
One of the features missing from the ATmega168/328 is a DAC. Doing a
PWM DAC is a reasonable compromise.
(* jcl *)
Location: Manchester (England England)
Solder is electric glue
Dec 09, 2009, 05:39 pm
For a more detailed explanation see:-