The circuit is much the same as we’ve done for previous lessons in that we have an LED connected through a 330-ohm resistor. The plotter lets visualize the output while the monitor writes messages out in a readable format. Today, not only are we going to do an analog write, we will also take a look at the Serial Plotter and Serial Monitor, tools that are included with the Arduino IDE. This indicates that this pin can be used for PWM. Note in the photo below that pins 3, 5, 6, 9, 10, and 11 each have the ~ symbol next to it. My Arduino Uno offers digital pins 2 – 13. I highly recommend watching Paul McWhorter’s video on PWM for a detailed explanation of how it works. Today we will use analogWrite to do it in a similar way, but now we will use Pulse Width Modulation (PWM) over an analog pin. So far we’ve been writing digital signals to control an LED.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |