week 12
interfaces and applications
<<<back

i revisted my molding and casting week to combine with networking and communication, and moved on to fusion360 and kicad to develop an internal structure and boards that fit inside my mold. i drew pieces that would fit inside the base, secure the top, and hold the microcontroller, button, and led, securely and in place inside the design.

i started by printing out the 3d printed parts.

and then designed in kicad so that i could separate the components and have the board and button fit perfectly.

and i finally used quentin bolsee's brilliant gerber conversion tool.

then i milled out my boards and they fit perfectly!

i tested out the board and realized that it didn't work and at first i couldn't figure out why, but i tested each of the pins on the led and i realized that it was actually an anode led! that's why it didn't light up properly. i had to do a redesign and make sure that the anode was attached to power instead of ground.

there was no datasheet so i hadn't realized, but testing made it very clear. i designed a new board in kicad and printed out a new baseplate for it, and stuffed the board.

then i wired it up and did a first test to make sure the anodes lit. instead of the usual command, digitalWrite(Pin, HIGH); to turn on power, because its an anode led, the reverse is true, pins have to pushed to LOW instead, and the line becomes digitalWrite(Pin, LOW);. And it works!

then i wanted to write a color-picker that i could control from my phone, so i used the seeed studio documentation to connect it to a hotspot on my phone. then i borrowed a js color picker script from jscolor

here is the simple interface!

in order to get it to work, i had do pwm writing to the rgb led pins using analogWrite, and because the color picker ouputs in (255, 255, 255), i had to amend the code to be redValue = redValue - 255; to adjust for the anode rgb led.

and it works!