Advanced use of LEDs
LEDs are a wonderful way of adding expressiveness to your robot. They are a cheap, easy to control, and very power-efficient way to create light in a large variety of colors. LEDs can be incredibly useful both as status indicators of your robot and as interactive elements that let your robot express its intention or its mood.
We have already learned how to control the LED of your Arduino Uno that is connected to pin 13, and how to let it blink using our custom Blinker
class that complies with the cooperative multitasking paradigm. But there is a lot more that we can do with LEDs, and a lot more to learn on how to control them and integrate them into your robot. So, let us get started!
Dimming LEDs
In our previous examples, all we did with the LED was turning it either on or off. This is usually enough to convey a status with an LED, or signal that the program is running. But there are many more effects we can create by learning how to change the brightness...