A Minecraft inspired desklamp that is controlled by an Arduino Nano and a RGB LED. The texture of the cube is sort of acurate compared to the game.
The button selects different ore colors or cycles through all colors.
5x white2.stl (make sure RGB LED can shine through this diffuser)
1x button frame.stl
I printed all in PETG but any material is fine. Glue all sides together and then the top. Paint it at this step. I also painted the white2.stl diffuser in the same (thin layer) color as the rest of the box to blend in better when the light is not switched on. I then glued the diffusers to the sides to cover up the holes.
Optionally if you want to use a button, a 6mm x 6mm fits in one of the small holes in the box. Glue the button frame.stl to the button it self and glue the button.stl to the movable part of the button. Then glue the assembly to the box from the inside so the button sticks out.
I then hot glued the button cables to the inside corners of the box so it was out of the way.
I carved the LED holder on bottom.stl to fit my LED and then hot glued it.
I also hot glued the Arduino Nano to bottom.stl so the USB port is ok and a USB cable can be connected. I put a small dab of glue in two opposite corners between the box and bottom so it holds together but easily can be separated if needed.
The main RGB face code comes from here: https://gist.github.com/surik00/6eb44d102d207bc94b9f9bd1c7e87c42
I then added the debounce code for the button.
The code is in minecraft.txt.
I also added another program that will cycle through the different Minecraft ore colors, Iron, Redstone, Lapiz Lazuli, Gold, Diamond and Emerald when the button is pressed. And then the last mode is a color rainbow. Then another click on the button switches off the LED.
1x Arduino (I used the cheapest I could find).
1x RGB LED (I used a cheap RGB Power LED and adjusted the resistors to limit the current to about 30mA for each color. It is bright enough at that current)
1x 6mmx6mm button
3x resistors of choice.
The Arduino is rated for 40mA for each port so 30mA should be safe. To calculate resistor values, just do a (supply voltage - LED voltage)/LED current. So in my case I got (5V-2.4V)/30mA=87ohm for red and (5V-3.6V)/30mA=47ohm for green and blue.
I just soldered the resistors to each LED pad and then connected them to port D3 (Red), D5 (Green) and D6 (Blue) and GND on the LED to GND on the Arduino. I then connected the button to D12 and to GND.