Digital I/O with Arduino Boards + Diffuser
The code below will control red, green, and blue LEDs. For every letter 'r', 'g', or 'b' the intensity of corresponding LED will increase by 10%. If the value goes over 255, the brightness will be reset to 0.
There is also an OFF command 'o', which turns all LEDs off.
CODE:
Description
In this lab assignment I have created a diffuser in the shape of a paper folded Stormtrooper.
By default the Stormtrooper has a blue-ish color but when you type "droid" in the serial monitor, the Stormtrooper turns all red! This way the Stormtrooper functions as a droid-alarm, the same way that Frodo's (from The Lord of The Rings) sword "Sting" glows blue, when Orcs are around!
**May The Force Be With You**
Components
Description
This program lets you increment the different colors by 15 percent. Inputs are 'r', 'g' and 'b'.
The syntax is a bit different from what I have coded before. Biggest problem for me right now is to understand the differences and to link it with the physical Arduino components.
Description
This is where you will put a description of your assignment. Write a couple paragraphs describing your approach. What does it do? Why did you choose this approach over others? What problems did you run into?
// description
my goal for the second part of this assignment was to cause the program to examine the string of text that was entered into the serial terminal, and output power values to the three leds proportionate to the distribution of the letters "r", "g" and "b" in the text input.
- « first
- ‹ previous
- 1
- 2
- 3