Click to view our Accessibility Statement or contact us with accessibility-related questions
Showing 1 of 359 conversations about:
LastContinue
164
Sep 17, 2018
bookmark_border
So thanks to @DarkMio @cryzed and @sky589 's inspiration, I spent the afternoon making a spreadsheet to help doing source code based LED layouts. Basically a nerdier version of the LED configurator.
I originally posted the link to it in another comment, but I don't want that comment to turn into a saga because the instructions for said sheet are long-winded.
Why would you want this?
1. Knowing (roughly) how the online configurator works 2. Having more options available to you than the online configurator provides (such as brightness, and caps key LED control) 3. Probably 100 more ideas I can't think of at the moment.
Disclaimer: This deals with quite a bit of math (albeit painfully simple once grok'ed). However, It's been a long time since my CS days, so there's probably a lot of bugs in there, but so far, "works on my machine"
Here's the sheet: https://docs.google.com/spreadsheets/d/1kiBfnmMFix5_T1oD7WCBvGF-wOoa0wvOVLMAP4B00jI/edit?usp=sharing
The idea (once you copy/download it) is that you put the value of the LED into one of the boxes marked LED Number in either one of the tabs and it'll spit out a value that you can put the source code if you've pulled down the MD QMK fork and want to hack.
Oh I'm assuming you've re-pulled down Massdrop's QMK Fork, because currently that's where the key-by-key layout code is living https://github.com/Massdrop/qmk_firmware/
Also, there are a couple of bugs (that the compiler will point out very quickly and are easy to fix, they are in keymap.c) so build the default before investing too much time. It's a nifty demo, I really like what the FN key does (It's not worth PR'ing because I'm sure this will be fixed and eventually wind up in QMK prime)
This was my target/inspiration https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L209
For making your own version, that you'll need to know the LED values, and the SUM of the 2^x values based on the LED's element mapping in their array
Long winded explanation: Skip if you just want to make maps! Sum? Yes, it's not just a simple leds = {1,2,3,4,5} style setup (boy I wish). It uses this techique called 'bitwise' (based on the comments in the code) that I never fully comprehended in my school days and I only did the bare minimum to re-education myself on today. Basically it's like a parity scheme that lets one number represent several addresses. If you look at the "Map" tab in the spreadsheet, you'll see there are 4 arrays, each of 32 elements. So if you want to just do spacebar, that's LED 80. LED 80 is 16th element in array id2. That means it's value is 2^16 😵😵😵. Want to do Spacebar + Alt? That's (2^16 + 2^15). Yes, a sum.
Back to Action So once you've gotten some LED values jotted down, you can go over to the "Values" tab and use the sheet (plus the ample scratch area) to put together your map. You'll need THE SUM of the binary values (probably incorrect term, but it's been over a decade since my CS studies) to put into the code.
Example: If you want "wasd" to be it's own color, you'll need LED's 36, 52, 52, and 54. Luckily these are all in id1. Using the "Values" tab, you can find out that these are elements 4, 20, 21, and 22 in id1. You can then pick any cell (although there's a "sum" cell as a "for instance", but really any will do) , start a `=sum(` function, and then click the values that correspond with elements 4,20,21,22. That will make 7340048.
Take that number and put it into a block of code like https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L209 with `.id1 = 7340048` as the address and you're ready to go. (If you want all of the other keys besides WASD, you can take (4294967295 - 7340048) which will give you 4287627247. Of course, that's only for id1. You'll need to do calculations for all of the other idX arrays)
Helpful snippets:
`.id2 = 4278190080, .id3 = 1073741823`
That's the entire underglow layer.
`.id0 = 4294967295, .id1 = 4294967295, .id2 = 16777215,`
That's all of the key leds.
`.id0 = 4294967295, .id1 = 4294967295, .id2 = 4294967295, .id3 = 4294967295`
That's EVERYTHING.
Edit: I fixed my repo enough to post the changed I made yesterday using the spreadsheet. https://github.com/LastContinue/qmk_firmware/blob/massdrop/keyboards/massdrop/ctrl/keymaps/lastcontinue/keymap.c#L217
Pulling the entire branch and then compiling the `lastcontinue` map will give you a pretty neat color scheme (I think).
(And again, if you don't want to use two keyboards to program this board, let alone two different commands, check out my helper script https://gist.github.com/LastContinue/ad5a526033e8965563e407d8f0b1b09e)
Sep 17, 2018
DarkMio
136
Sep 17, 2018
bookmark_border
LastContinueHere's what happens when you open the the case, I was lubing and silencing the stabilizers, figured out that the stabs come pre-lubed.
Sep 17, 2018
Valen
42
Dec 17, 2018
bookmark_border
LastContinuewhich header file contains the definition of `led_instruction_t`, `led_instruction_s`? edit: /tmk_core/protocol/arm_atsam/led_matrix.h
(Edited)
Dec 17, 2018
LastContinue
164
Dec 17, 2018
bookmark_border
ValenThere might be a copy in there, but I'd avoid messing with that unless you have some major functionality you'd like to add. If you're just wanting to a key-by-key color config, then keymap.c will get you there. Checkout https://github.com/LastContinue/qmk_firmware/blob/lc_sandbox/keyboards/massdrop/ctrl/keymaps/lastcontinue/keymap.c#L207
Dec 17, 2018
Valen
42
Dec 18, 2018
bookmark_border
LastContinueyeah I am messing up with `keymap.c` only, now I have implemented "activate on press" (but I am unable to do fade out if I want to use `LED_FLAG_USE_ROTATE_PATTERN`) I'm going to do splashing, wish me all well 😊
Dec 18, 2018
Valen
42
Dec 18, 2018
bookmark_border
LastContinuelive on http://github.com/valen214/Massdrop-Ctrl-Keyboard-Splash-LED I might create a new post talking about this.
(Edited)
Dec 18, 2018
LastContinue
164
Dec 20, 2018
bookmark_border
ValenDemo video looks really great! 👏 I'm not very familiar with the format of how you did your repo 😅 , so if I wanted to try this with my own repo, could I just copy and paste this file, or would I need more? https://github.com/valen214/Massdrop-Ctrl-Keyboard-Ripple-LED/blob/master/keyboards/massdrop/ctrl/keymaps/valen214/keymap.c

Dec 20, 2018
Valen
42
Dec 20, 2018
bookmark_border
LastContinuekeymap.c is enough
Dec 20, 2018
Valen
42
Dec 20, 2018
bookmark_border
LastContinueI am wondering if setting `led_instructions` is an over-kill or not, as seems that some functions are provided to set rgb light https://beta.docs.qmk.fm/features/feature_rgblight

Dec 20, 2018
LastContinue
164
Dec 20, 2018
bookmark_border
ValenAwesome! I will try this at home tonight! rgblight question -> you already seem to more about this than I do, but I'll be your guinea pig for anything else you come up with! I have a sneaking suspicion that those wouldn't work with this board as the chipset it uses is pretty unique in terms of QMK, but definitely worth trying! "Good luck" and "great work"!
(Edited)
Dec 20, 2018
LastContinue
164
Dec 21, 2018
bookmark_border
ValenSo I got this to work just by copying one of the keymap.c's to my local. I got this error `error: implicit declaration of function 'uprintf'; did you mean 'dprintf'?` But I just changed that around and it seemed to work. The effect is nuts! I'm going to slowly pick over this and document parts as I understand them on my wiki. Great work 🙇‍♂️ This is something that would have taken me months of hacking around.
Dec 21, 2018
Valen
42
Dec 21, 2018
bookmark_border
LastContinueNice, the 'uprintf' is just for debugging purposes and can be removed safely. One more important thing, I've come up with a new solution of how to calculate the position of dripple wave (sort the DISTANCE_MAP by distance), which could reduce the complexity of 'matrix_scan_user()' by log scale! I will do it as soon as I get my hands on a computer. It turns out that the original `matrix_scan_user()` is doing fine in terms of performance (keystrokes * led_numbers + led_numbers ~= 10 * 87 + 87 ~ 1000 number of for iteration), still doesn't take 1 millisecond in 99 iterations, but I would still going for the new approach.
(Edited)
Dec 21, 2018
myroblyte
37
Jan 1, 2019
bookmark_border
Valenhey valen, i followed all the instructions from your github post, but whenever i put the whole mdloader_windows.exe thing into cmdprompt, i get this message: Opening port 'COM3'... Success! Found MCU: SAMD51J18A Bootloader version: v2.18Sep 4 2018 16:48:28 Applet file: applet-flash-samd51j18a.bin Applet Version: 1 Error: Parser: Hex: Invalid start code! (Line 1) Error: Could not parse file! Closing port... Success! idk what do do at this point, im new to all this stuff. appreciate your time.
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblyteyou might try the .hex file instead of .bin (or vice versa if you were using .bin) I don't quite understand what do you mean by "put the whole mdloader.exe into cmd", could you show me how did you execute the command? if you want to follow how I did (like this `./.build/mdloader_windows.exe --first --download massdrop_ctrl_custom.bin --restart`) you should execute the exact same command in the project root folder. But tbh, if you are not modifying any of the code, running `download_and_install.bat` inside `.build/` folder is good enough (you don't even need to fork the whole project, the .bat file alone is enough)
(Edited)
Jan 1, 2019
myroblyte
37
Jan 1, 2019
bookmark_border
Valentried that too, got the same error
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblytetried the .bat file too? just double click and reset the keyboard, nothing else required
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblyteI am quite sure you did not try the .bin file, because I checked out the source code of mdloader which gives that same error only with .hex file but I didn't have problem with .hex file either. You gave too little information and I could not figure out the cause of you problem from what you gave. You could try the .bat file, watch the video, or ask more if you stick to CLI.
(Edited)
Jan 1, 2019
myroblyte
37
Jan 1, 2019
bookmark_border
Valeni retried with the bin file. this caused me not to be able to type on it and the led's to shut off. i had to load one of my configs onto it, and then it worked again. here is what i typed after changing the directory to the folder i was using. mdloader_windows.exe --f -D custom.bin --restart i hit the kb's reset button and it stopped working. thoughts? when i try the .bat file: mdloader_windows.exe --first --download download_and_install.bat --restart i get a message saying the filename must end in .hex or .bin
(Edited)
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblyteno, just double click the .bat file is good enough in command line `download_and_install.bat` and enter
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblyteI inputted `custom.bin` because I named the file as `custom.bin`, if you fork the file from the github project the file name is `massdrop_ctrl_custom.hex` (or .bin)
Jan 1, 2019
myroblyte
37
Jan 1, 2019
bookmark_border
Valenyeah i also renamed the files as custom.hex and .bin. i don't get where to double click the .bat file. on github? in cmdprompt? in files? what leads up to that?
(Edited)
Jan 1, 2019
Valen
42
Jan 1, 2019
bookmark_border
myroblyteusually a double clicking on a batch file (in the file explorer) will execute the bat file with command prompt. (of course for it to exist in your file explorer you need to download it)
Jan 1, 2019
myroblyte
37
Jan 1, 2019
bookmark_border
Valensorry, i was confused. when i double click the bat file in files, cmdprompt opens for a second and then closes
Jan 1, 2019
LastContinue
164
Jan 2, 2019
bookmark_border
Great Question! I don't have an ALT myself, and I haven't looked at the spreadsheet that's come from for a while. The definitive answer for that is to look on the board itself and look at the numbers written on the PCB next to the lights.
Jan 2, 2019
Valen
42
Jan 2, 2019
bookmark_border
myroblyte
search
this is what I see when I execute the batch file, which basically only contains 4 commands, I guess you don't have `curl` in your cmd, which is indeed I haven't considered of, I might change it to use powershell so later you can use. Back to your question, I believe you might download the file in a wrong way or have a corrupted file, because I never experienced that error. You might try to do everything from scratch again or use the .bat file later when I updated. BTW, if you want to check what error message that executing a .bat (or .cmd or .ps1) gives, you can execute it in a cmd by simply typing the file name `some_executable.bat` (which I mentioned earlier) to figure out the problem. EDIT: added `download_and_install_powershell.ps1` double click on it might open it with notepad directly so, either right click -> open with powershell or do it in command.
(Edited)
Jan 2, 2019
myroblyte
37
Jan 2, 2019
bookmark_border
Valenive kind of given up at this point. thank you for your time. i think someone like me needs a detailed step by step explained tutorial on how exactly to do this, and i would not want to impose on you
Jan 2, 2019
Valen
42
Jan 3, 2019
bookmark_border
LastContinuehaha, it toke us much time to figure out that the id2 for underglow is not correct (missing id 88). so the correct value of .id2 should've been 4286578688.
Jan 3, 2019
LastContinue
164
Jan 3, 2019
bookmark_border
ValenGlad you got it figured out! It wouldn't surprise me that all of those numbers are wrong.
Jan 3, 2019
Valen
42
Jan 10, 2019
bookmark_border
LastContinueSorry to bother you, but may I ask where to obtain such information about led ids? `./keyboards/massdrop/ctrl/info.json` seems provide some (but I am uncomfortable to use it). edit: I mean how to relate keycode to led id
(Edited)
Jan 10, 2019
LastContinue
164
Jan 10, 2019
bookmark_border
ValenI found it here https://github.com/LastContinue/qmk_firmware/blob/lc_sandbox/tmk_core/protocol/arm_atsam/led_matrix.h#L125-L128 (referencing my fork, but MD fork will probably have it in that location too) After that, it was a matter of just setting each .idX = 1,2,3, etc and seeing what happened so I could find the how the lights were laid out on the board. (and then taking the board apart helped confirm it)
(Edited)
Jan 10, 2019
kokozweeb
0
Jan 17, 2019
bookmark_border
DarkMioI was so happy it came aplied with high quality stabs! Now I dont have to buy shitty ones :D
Jan 17, 2019
fullCircle801
3
Jan 19, 2019
bookmark_border
ValenHey @Valen I just checked out your repo and I love what you have done. Can you tell me the differences between the custom, custom_activate_on_press, and responsive_pattern keymaps? I'm also trying to make another layer like FN layer where certain keys change colors when the layer is active but I'm having issues. I tried to mimic what you are doing with "QWEASDP" and "YUIOHJKL" but when my new layer is active the keys I want aren't lit and it just shows your second layer with the blue 5 and stuff. Any ideas would be much appreciated.
(Edited)
Jan 19, 2019
Valen
42
Jan 20, 2019
bookmark_border
fullCircle801"custom_activate_on_press" was a initial draft and is no longer maintained. "custom" is using the implementation that LastContinue introduced (which is modifying "led_instructions"), but this method have several problems, one is that being incompatible with newest QMK firmware, then second one is the same that you are facing. There are some variables that have to be properly set in order for the led instructions to work (because for loop will only iterate to certain point). As a result, I recommend you to try to have a look on "responsive_pattern", it is compatible with qmk, and more importantly, fairly easy to understand.
Jan 20, 2019
Shanoob
0
Jun 2, 2022
bookmark_border
ValenHi Valen, I just bought a Drop Ctrl keyboard and I came across your amazing github repo and fumbled my way around for hours and managed to get it all working haha Firstly, thank you! It's so good what you've done to bring to life some additional RGB lighting options to the really lacking stock ones that come with. I have a quick question (it's probably out of my abilities as I'm not a dev). I see you have currently 6 RGB settings which are great, but I wanted to add an additional one which is just a slight modification of one of your existing ones. I'm assuming the only way to do that is to get stuck into the code? Anyway, fingers crossed you check these messages. But if not, thanks again for your great work
Jun 2, 2022
View Full Discussion
Related Posts
Trending Posts in Mechanical Keyboards