I partnered with KC on this assignment.
Our task this week:
- A control to turn the light on and off. When it turns on, it should retain the relative red, green, and blue brightness levels from when it was last turned on.
- The ability to fade each color channel (red, green, and blue) from off to full brightness
- Fade level should be maintained when you release the fade controller
- Fade should be interrruptable by other controllers, e.g. on/off or another fade controller
- The ability to fade the overall brightness of the light
I started too ambitious out in the project yet again as started to focus on the form rather than the function. Once I dialed it back, I began to work with KC to solve the coding issues we were having.
Layout and Wiring
After wiring everything correctly as shown by both the Fritzing model and the images below, we began to debug the code and see what was wrong in terms of mapping the values from the potentiometers.
We ran into a few problems, some that we were able to solve and others which we could not solve in the time this assignment allowed for.
Problem 1: LED was not turning FULL Red/Green/Blue – Solved!
For some reason, mapping only worked from 0 to 673, which we then mapped to 0-255, which worked! We originally had it mapped to 672, and after seeing the additional value in the Serial Monitor, we changed the mapping and got the lighting working for a while.
Problem 2: 255 and 0 were reversed – Unsolved
For some reason, the ‘0’ and the ‘255’ were reversed. We changed the wiring and reversed the range in the code, but could not figure out why these were revised when we view the data in the Serial Monitor.
Problem 3: After soldering and assembling, the entire thing stopped working.
After spending the time to solder and make sure all connections had current running through them, we were surprised to realize that our LED began blinking random colors. We could not test the rib values as they kept changing everything the light changed automatically to a different color. We tried a different Arduino, a different breadboard and even combed through the code, and couldn’t find what could be wrong with this.
Considerations for Next Time
I would have incorporated the switch at an earlier process during the build/test phase instead of towards the end, which complicated things temporarily. Once I find out what was wrong with the soldering problems, I will incorporate that feedback here.