Skip to content

Arduino Code for turning a NovelKeys Big Switch into an RGB Lamp

License

Notifications You must be signed in to change notification settings

schmintendo/BigSwitchRGB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Big Switch RGB Lamp

Tutorial for turning an Arduino Pro Micro, some RGBs, and a NovelKeys Big Switch into an RGB Lamp

Getting Started

What you'll need to get started is a Pro Micro/Elite C/any Arduino, some RGBs, and a switch (and some wire!). Here's what I got:

  1. SparkFun Qwiic Pro Micro - USB-C
  2. Neopixel/Neopixel Clone RGBs - You can get a bunch of different kinds of these! These are just the ones I picked.
  3. NovelKeys Big Switch - Obviously you can use any switch, or button, but these were the inspiration for this project.

I'll assume you've worked with Pro Micros before, but if you haven't, here's a setup guide to get the Arduino IDE and associated drivers on your system.

Now that you have your Pro Micro setup, make sure you can see it on your computer, using Device Manager, or QMK Toolbox if you have that installed, or Arduino's IDE. A lot of Pro Micros come bricked, so hopefully yours is working. The Elite Cs are usually more reliable, but only 2 out of the 3 Pro Micros I used to prototype this project were recognized in Windows.

Circuit Diagram

alt text

Code

While most of the code is explained in the file itself, I'll go over the general reasoning for why I did what I did.

My code basically swaps between modes when I press a button, since I wanted a few different colors for my LEDs - RGB cycling, Solid Pink, and "off" (Black). I used the FastLED library to control the LEDs, and the Bounce2 library to add debounce, and everyone online seemed to suggest it when using buttons.

For the color cycling, I stole the code from somewhere, but it's pretty self explanatory, the H part of the HSV infinitely increments over time, resulting in smooth color changing of the LEDs.

If you don't get anything, feel free to message me on reddit! I'll try my best to explain it. My username is /u/schmintendo.

Things to keep in mind

The HSV in FastLED and typical HSV color codes are not the same. This is documented here: https://github.com/FastLED/FastLED/wiki/FastLED-HSV-Colors I might make a FastLED HSV to normal HSV converter at some point, but for now, here are the calculations to change the typical color codes from a HSV color selector like this one to FastLED HSV codes:

FastLED H: (H*256)/360

FastLED S: (S*256)/100

FastLED V: (V*256)/100

References

If you want a QMK version of this project, check out this link: https://www.reddit.com/r/MechanicalKeyboards/comments/7oiv5o/guide_how_to_make_a_big_switch_lamp/

That was my inspiration, and that person used QMK so you don't have to use Arduino compatible ATmega32U4 boards. Hint hint, use an Elite C.

Releases

No releases published

Packages

No packages published

Languages