digitalWrite() vs analogWrite()
What are differences between digitalWrite() and analogWrite()?
- digitalWrite() function controls Arduino's pin to LOW or HIGH. Accordingly, We can use this function to turn on/off something such as:
- Turning on/off LED
- Turning on/off Light Bulb
- Turning on/off DC motor
- Turning on/off Solenoid Lock ...
- analogWrite() function generates PWM signal to Arduino's pin. Accordingly, We can use this function to control something such as:
- Controlling the brightness of LED
- Controlling the color of RGB LED
- Controlling the speed of DC motor
- Controlling the angle of Servo motor ...
See more in function references:
|1 × Arduino UNO Buy on Amazon|
|1 × USB 2.0 cable type A/B Buy on Amazon|
|1 × Jumper Wires Buy on Amazon|
Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.
The Best Arduino Starter Kit