Ada Developers Academy Capstone: Day 14

Not too much to report for day 14; crafting, soldering and moving logic to the API.

I had my friend Amanda help me put the LEDs into the box. It was a good time. First we took the strip out of it’s silicon casing. I couldn’t believe how much brighter the lights got! Then the struggle was putting velcro on the back of the strip so that I could remove the lights from the box if I needed to. However, between the hot glue and bending the strip, we broke the connect between the first LED and the rest of the strip. And the velcro wasn’t sticking to boot. Oops. Luckily, I know how to solder. It was a bit tricky, and I lost one more LED, but 58 LEDs is still a good number of LEDs. In the end we actually decided to hot glue the ends of insulated paperclips into the sign and then slip the strip into the carefully placed paperclips. Don’t look inside the sign, it’s not that pretty. Now the struggle is how to better protect the mirocontroller on the back of the sign. Dan had given me a box, but it’s bulky and you can’t see the pretty microcontroller. Right now I have it taped with masking tape… I’m not going to take a picture… though the front of the sign looks beautiful… I’ll take a picture of that instead!

I like the rainbow color. That’s nice.

The second thing I did was try to move some of the logic code out of the micro controller and into the API.

At first I thought that I could send the hex code from the front-end to the api, and then convert the hex code into a number for the mircocontroller to read, and end with a C++ switch case that would set the color. As it turns out though, pushing a hex code to my API is not as easy as it seems. No matter what I did, even if I just tried to put a hex code in a string and send it by PostMan, the ‘#’ kept erasing it! I tried to find articles on it, and I found nothing. I decided in the end to stay with the strings that contained the rgb hash for the color, e.g. ‘{“r”:0,”g”:0,”b”:255,”a”:1}’ => blue. In the API I have that string being translated into a number and then when the mircocontroller asks for the color, it just gets a number. I then use a switch statement in the C++ code to identify which color to show. I think I can try one more thing to clean up the code since so much is hard-coded at the moment. I’m going to try to parse the string and send the color as rgb to the mircocontroller. First though, I’m going to look into that server problem that I keep saying I’m going to look into.

Oh, I also added rainbow color as an Easter Egg. It looks good!

I’m glad the sign works. Back to doing clean-up for me!