Replies: 1 comment
-
Good idea, In 2008 when I bought my first Arduino, I expected analogWrite was for a DAC since analogRead was for an ADC. It was already to late then, in about 2004 Massimo Banzi adopted Hernando Barragán's Wiring API for what became Arduino. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This contribution has been made @dsyleixa over here.
there is 1 thing about analogWrite() which should be considered to be changed:
Some boards (e.g. M4) have (real) analog output ports providing a DC voltage.
OTOH, what analogWrite() actually does for digital pins is a digital pwm output, not analog at all.
The things become totally confusing for board pins which can be either digital or analog, both for reading and writing.
So I would suggest to RENAME analogWrite() for DIGITAL pins to pwmWrite() and use analogWrite just for ANALOG output for the future.
In the medium term analogWrite might also still support pwm as before (albeit deprecated), but at least initially pwmWrite () should also be introduced for pwm additionally.
Beta Was this translation helpful? Give feedback.
All reactions