Loading topic
digitalWrite(pin, HIGH) turns an LED on and digitalWrite(pin, LOW) turns it off. Fading an LED needs something in between, such as 40% brightness. This chapter explains why the pin cannot do that on its own. It also lists wha7 min readsetup() and `loo7 min readpinMode and digitalWrite, and know Ohm's law at an introductory level. It connects the duty cycle to a number you can measure, the average voltage. It then shows why that number only partly 8 min readsetup() and loop(), use pinMode() and digitalWrite(), place parts on a breadboard, and apply Ohm's law (V = I × R). The 8 min readsetup() and loop(), wire an LED with a resistor on a breadboard, and read an Arduino pinout diagram. The earlier chapters covered duty cycle and analogWrite(). Here you will learn which pins can produce PWM, how to confirm that in software6 min readsetup() and loop(), use pinMode() and digitalWrite(), wire an LED and resistor on a breadboard, and apply Ohm's law at an introductory level. It als7 min readsetup() and loop(). It also assumes you have wired an LED with a current-limiting resistor to a PWM-capable pin, such as pin 9 on an Uno, and that you know what analogWrite() does. Here you will turn a single brightness value into 7 min readanalogRead(), scale the result to the range analogWrite() accepts, and handle the problems that appear on real hardware: noise, out-of-range values, and the choice of scaling method.7 min readanalogWrite() values looks uneven to the eye, and how to fix it with a gamma curve. It assumes you have read the earlier chapters of this tutorial. You should be comfortable with duty cycle, analogWrite() with its 0 to 255 range, an LED wired7 min readanalogWrite() on an Uno and know what duty cycle means. It also assumes you have seen a volatile or register name in AVR code before. You do not need to have used registers. The goal is to explain why analogWrite() produces the frequency it does, how to7 min readanalogWrite(). It also assumes you know what duty cycle and PWM frequency mean, and that you have used Ohm's law to size a resistor. Here we look at where PWM stops working well and what to do about it. The topi9 min read