This week I focused on making the LED strips for my jersey project work. I want four settings, gold, purple, purple and gold, and purple and gold going around in circles. I adjusted the RGB values in the example Neopixel code just to see what it would give me, but I had to use an RGB color picker online to get the gold and purple that I needed. I ended up using (252, 90, 0) for gold and (128, 0 128) for purple. By adjusting the example code, which was green and had one LED go along the strip then fill up with whole thing with one color, I was able to get a solid gold and purple color. With some help from Cormac, I got the strip to split the strip in half, 10 LEDs gold and 10 purple. The only setting I had left to do was the one where it goes around, and I had a lot of trouble figuring it out. At first, only one LED was working then two, and I couldn't figure out what was going on. Eventually I got a rough version of it to work, but eventually I want to make is faster and better. For now though, I have all four settings that I wanted.
The next part of making the strip work was to be able to switch between the four different modes with a remote. I used one of the remotes from the supply closet and an infrared receiver to control it. All the sensors have the TSOP model followed by random numbers, so finding the right diagram online was very hard. Originally, I used a TSOP3938 sensor, but when I plugged everything into my breadboard and uploaded the code I smelt something burning and the sensor was burning hot. I went through one more of these sensors before I realized I was supposed to be using the TSOP3227 instead, and I had ground and power switched. After getting a new battery for the remote, I found some example code to test it. When a button is pushed, a string of Fs appears on the serial monitor, meaning that it detects data but doesn't know what it is. Each button on the remote has it's own HEX value, but I wasn't aware of that when I started coding.
My main goal was to make gold switch the purple and stay purple when I pressed a button, but the farthest I got was only making it purple when I pressed the button before going back to gold. I mixed different code from examples and guides I found online on how to toggle the remote, but I modified it to try and make it work for what I needed. No matter what code I used or which remote I used it wasn't reading the specific values of the buttons, only printing Fs. After doing some research, I'm pretty sure I need a specific type of remote to make it work. I'm currently using an MP3 remote for sound systems, but that shouldn't matter. If the new remote doesn't work I'm not sure what else to do, but this week as a whole has helped me get better with code and understanding how everything works.
Commentaires