My personal expectation was that I could change the color of the front three-point LED by changing the settings. But apparently it's different.
I thought that it would be clear if I read C language, but I have been using C language for work for more than 10 years, but I gave up because I didn't have the ability to read C language. It's not stupid to experience. You can see how important knowledge is. What has been the last 10 years ... No genius will value gaining experience. However, Bonkura inevitably prioritizes experience over study.
for that reason···.
There is a premise that I didn't intend to make it shine when I bought the keyboard. However, I ordered the one with LED lighting because it would not be possible to purchase the same keyboard additionally if I bought one. (Where did you talk about the front LED)
Official ErgoDoxEZ Twitter account: @ErgoDoxEZ
Below, the main subject ...
Below, still foreplay ...
ErgoDoxEZ Try out the new configurator Maybe it's the official page, so I can do it. However, only 5 colors can be set, and above all, even though there are 30 LEDs on the left and right, the colors cannot be set individually. Even though it's official ... The biggest drawback is that the LED lights up when you press the set key.
massdrop configurator This is a type of GUI operation where the LED cannot be turned on.
Keyboard Layout Editor I have Help, but I don't know how to use it. However, I'm sure it can be done because there is a description of the LED. I can't understand it in English, but I found an explanation video. Introduction to Creating Custom Mechanical Keyboard Keycap Sets, Cases, and PCBs
Infinity ErgoDox I'm not going to betray the ErgoDoxEZ, but it seemed like it could be used, so I'll introduce it for the time being ... After all, I don't know how to set this with the LED. Maybe it doesn't work with QMK (it seems to work differently from ErgoDox).
For self-satisfaction, no one else is involved and does not step in. Therefore, GUI operation can only do some things, and some things cannot even be done to some extent. I came to that conclusion.
Therefore, the LED Lighting change method may not be published (I just don't know). But unfortunately I'm crazy and I can't change it without telling someone how to do it. "Tell me Kure Kure"
Finally insert it into the main subject. The [red, green, blue] LED lights up.
First of all, I want to suppress strong light.
The method introduced here is just to change the light intensity.
Clone Git directory \ github_repository20180604 \ qmk_firmware \ keyboards \ ergodox_ez
ergodox_ez.c
There is a function named "ergodox_blink_all_leds".
There is a function call called "ergodox_led_all_set" that controls the light intensity of the three types of LEDs on the front, and the LED_BRIGHTNESS_DEFAULT
value is passed as an argument there.
This indicates that it lights up with strong light (it may not be strong because it is a standard intensity).
Therefore, if you rewrite it as LED_BRIGHTNESS_LO
as weak light, the light can be suppressed.
For strong light, specify LED_BRIGHTNESS_HI
.
The top is strong light and the bottom is weak, but it is unlikely to be comparable because there is no shooting technology.
The following function is used to determine the intensity of light.
ergodox_ez.h
inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; }
inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; }
inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; }
inline void ergodox_right_led_set(uint8_t led, uint8_t n) {
(led == 1) ? (OCR1A = n) :
(led == 2) ? (OCR1B = n) :
(OCR1C = n);
}
inline void ergodox_led_all_set(uint8_t n)
{
ergodox_right_led_1_set(n);
ergodox_right_led_2_set(n);
ergodox_right_led_3_set(n);
}
Until now, I used ʻergodox_led_all_set, but if you want to make it shine individually, you can use ʻergodox_right_led_ [1-3] _set
.
So, the image below is the result of setting LED1 (red) to 1 and passing 0 to LEDs2 and 3.
Green (LED2) and blue (LED3) passed zero, so I thought they were unlit, but they are shining. It's strange. Can anyone please tell me why it shines? (Since there is no shooting technology, it seems to shine strongly, but it is quite weak)
Since the strength is difficult to understand, I changed it as follows. (The value written in the comment "← this." Is the image below)
ergodox_ez.c
void ergodox_blink_all_leds(void)
{
ergodox_led_all_off();
// ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT); //Original 20180828
// ergodox_led_all_set(LED_BRIGHTNESS_LO); //Suppress the light.
ergodox_right_led_1_set(1); //Red ← this.
ergodox_right_led_2_set(0); //Green ← this.
ergodox_right_led_3_set(LED_BRIGHTNESS_HI); //Blue ← this.
ergodox_right_led_1_on();
_delay_ms(50);
ergodox_right_led_2_on();
_delay_ms(50);
ergodox_right_led_3_on();
_delay_ms(50);
#ifdef LEFT_LEDS
・
・
・
}
Since red is set to 1, it is understandable that it glows weakly. Why is there light when green is set to 0? In both cases, the blue color is too strong and it is difficult to see. Since blue is maximized, can you see that the light is reflected even on the keycaps?
To make the front LED shine, I found out above that it was lit due to ʻergodox_right_led_1_on`. When I checked the contents, I found that it was controlled by the following two lines (I just started a new line without permission, actually one line).
ergodox_ez.h
inline void ergodox_right_led_1_on(void)
{
//Red
DDRB |= (1<<5);
PORTB |= (1<<5);
}
inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } //Green
inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } //Blue
You can see that we are trying to control the bits by shifting the number 1 to the left (1 << 5) by five. The point is, 0x20 (0b00100000), right?
Speaking of my girlfriend, Right Hand, who has a side dish of AV, you might imagine the AVR of a microcomputer, but some people may not understand it.
I am one of them.
There seems to be a microcomputer called PIC, but is it okay to think that the ErgoDox EZ uses an AVR microcomputer?
I set 0b00000001
without knowing it, but it doesn't shine at all.
ergodox_ez.h
inline void ergodox_right_led_1_on(void)
{
//Red
DDRB |= (0b00000001);
PORTB |= (0b00000001);
}
The point is that there are only three LEDs, so is it okay to use them in order from the leftmost bit? Is the rightmost 5 bits free? In this part, I thought that it was a combination that could change colors such as yellow and purple, but can't you do such an advanced thing? Is the color fixed?
Is the following effort useless?
keymap.c
// Runs whenever there is a layer state change.
uint32_t layer_state_set_user(uint32_t state) {
・
・
・
uint8_t layer = biton32(state);
switch (layer) {
case 0:
・
・
・
case 1:
// ergodox_right_led_1_on();
DDRB |= (1<<5);
PORTB |= (1<<5);
// DDRB |= (0b00100000);Red
// PORTB |= (0b00100000);Red
// DDRB |= (0b01000000);Green
// PORTB |= (0b01000000);Green
// DDRB |= (0b10000000);Blue
// PORTB |= (0b10000000);Blue
// DDRB |= (0b00110000);Red
// PORTB |= (0b00110000);Red
// DDRB |= (0b01010000);Compile error
// PORTB |= (0b01010000);Compile error
// DDRB |= (0b10010000);Blue
// PORTB |= (0b10010000);Blue
// DDRB |= (0b10100000);Red and blue
// PORTB |= (0b10100000);Red and blue
// DDRB |= (0b11000000);Patina
// PORTB |= (0b11000000);Patina
// DDRB |= (0b01100000);Red-green
// PORTB |= (0b01100000);Red-green
// DDRB |= (0b11100000);Red green blue
// PORTB |= (0b11100000);Red green blue
// DDRB |= (0b00000001);The LED in the foreground is not displayed.
// PORTB |= (0b00000001);The LED in the foreground is not displayed.
// DDRB |= (0b00000010);The LED in the foreground is not displayed.
// PORTB |= (0b00000010);The LED in the foreground is not displayed.
// DDRB |= (0b00000100);The LED in the foreground is not displayed.
// PORTB |= (0b00000100);The LED in the foreground is not displayed.
// DDRB |= (0b00001000);The LED in the foreground is not displayed.
// PORTB |= (0b00001000);The LED in the foreground is not displayed.
・
・
・
#ifdef RGBLIGHT_ENABLE
・
・
・
Port register and [IO port C language macro, etc.](http://startelc. I checked the functions of DDRB
and PORTB
in com / AVR / Avr_100macroMemo.html "Starting electronic circuit"), but I couldn't understand it.
Depending on the type of LED, it may be monochromatic or multicolored.
I wonder if it doesn't work unless the same value is set for these two types of functions for light emission.
I still don't understand the part that is in error ...
I just want to use the keyboard, but I don't understand why it takes so much time and effort. You can see how good the commercial products are.
If the color cannot be changed and it is fixed, there are 6 different displays ...
Assuming that layer 0 does not emit light, will there be 7 types of light emission from layer 1 to layer 7?
I intended to learn combinations and permutations at junior high school, but I can't make use of what I learned at school.
It's hard to realize how abandoned human beings and lived without studying.
ErgoDoxEZ has a function to make you aware of the sweetness of life ...
Unfortunately, as long as there are 7 types of existing source code, let's follow.
After layer 8, there is no light. I'm very sorry, but if you want to make it emit light, you need to add it individually.
After case 7:
, it should be default:
.
During this time, you can assign as many numbers as you like, such as 8 and 9, and let the 3 types of LEDs emit light as you like.
It seems to be confusing because the light emission overlaps with other layers, but for the time being, I think that it can be judged that the layer is not 0.
I spend a lot of time and effort on LED lighting, buying expensive keyboards without any income for job hunting. I was in trouble because the pioneer did not make it shine, but I am grateful that there is only one volunteer who has disclosed how to make it shine.
ErgoDox introduction Change the color of the rear LED when the layer is switched Based on the source code, I also want to make my ErgoDox EZ shiny. It was.
In the first place, I wanted to change the color of the front LED because it was unpleasant for layer 1 to glow red, so I wanted to change it to blue, yellow, and red like a traffic light. I didn't want to use red because I thought it was a danger signal. And I wanted to make the back LED emit light according to the color of the front LED. There is no problem with repulsion (?), But I would like to match it if possible. by the way, Back side? back? Is it right?
Let's assume that you understand that you want to embed a layer 1 LED emission program in the above ["case 1:"] in [keymap.c](#question from here).
keymap.c
case 0:
・
・
・
#ifdef RGBLIGHT_ENABLE
rgblight_disable();
#endif
break;
case 1:
・
・
・
#ifdef RGBLIGHT_ENABLE
rgblight_enable(); //Effectiveness
rgblight_setrgb(0xff,0x00,0x00); //← This.
#endif
break;
If you give a color setting to the argument of the rgblight_setrgb
function, the rear LED will certainly change.
However, there are two problems.
These two types are different, so I'll try to solve the second one first.
When returning from the emitting layer x to the 0 layer, I wanted to turn off 0.
I don't think it's possible to suppress light emission with colorless (not white) (because I think it's energized).
Therefore, I disabled it (disable
), but when it was enabled (ʻenable`), there was light emission at the time of switching, and all colors (default color?) Lighted up for a moment.
I had no choice but to keep it enabled (orz to compromise immediately).
keymap.c
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
rgblight_enable(); //Valid ← this.
#ifdef RGBLIGHT_COLOR_LAYER_0
#endif
};
Added the activation process to the existing function. Delete the processing that has already been added.
keymap.c
uint32_t layer_state_set_user(uint32_t state) {
・
・
・
// rgblight_disable();
・
・
・
// ergodox_right_led_1_on();← Front LED emission
・
・
・
// rgblight_enable();
・
・
・
I'm not sure if this is the way to go, so please let me know. The purpose is not to energize when it is not emitting light. For the time being, I suppressed the extra light emission of the one cushion.
When using the rgblight_setrgb
function, all the LEDs change color and emit light without any questions.
Again, there are new issues, but I don't care (dazzling).
If you want to emit light individually, you can solve it by specifying one by one, so it does not require much effort.
Just use the rgblight_setrgb_at
function and specify the above color specification plus the place you want to emit light.
It should be noted that the array starts from the 0th because it is C language.
If you have an array called tmp [5]
, specify tmp [0]
to set the value at the beginning.
The maximum 5th is tmp [4]
.
This time there are 15 LEDs on one side, so if there is an array of LED [15]
, the end will be LED [0]
and the other end will be LED [14]
.
For the time being, it was avoided that all 30 LEDs were filled with one type of specified color.
Anyway, I wanted to do this for the time being. First of all, from the result ...
The front side of the photo is the left hand part, and the back side is the right hand part.
On the left hand side, the right end in the inverted state is LED [0]
.
On the right hand side, the left end in the inverted state is LED [0]
.
The point is that both sides become LED [0]
when placed, and the value increases as it goes inside.
Left hand (LED [0] [1] [2] ~ [12] [13] [14]) Right hand (LED [14] [13] [12] ~ [2] [1] [0])
The reason I say "for the time being" above is that other problems have not been solved.
I can't reduce the amount of light ⇒ [Solved by using HSV instead of RGB](https://qiita.com/chesscommands/items/5cbd92e61b96ffaa0991#%E5%85%89%E9%87%8F%E8%AA% BF% E6% 95% B4 "How to adjust the brightness of LED Lighting of ErgoDox EZ") As for the front LED, the light intensity was weakened as at the beginning, but I do not know how to do it on the back.
Left and right cannot be separated. Even though it is a separate left and right type, it cannot be illuminated only on the right hand side or only on the left hand side.
I'm sure there is a way to do it, but it won't be solved unless you have poor programming knowledge and can chase existing programs. There was no commentary on the internet. Is it natural to be able to do it?
The program in the above picture is placed below (hopefully helpful).
keymap.c
case 1:
・
・
・
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb_red_at(0);
rgblight_setrgb_at( 255, 0, 255,1);
rgblight_sethsv_turquoise_at( 2 );
rgblight_setrgb_at( 255, 255, 0, 3);
rgblight_setrgb_at( 255, 0, 255, 4);
rgblight_setrgb_at( 0, 255, 255,5);
rgblight_setrgb_at( 255, 255, 255,6);
rgblight_setrgb_at(0x00,0x00,0xff,7);
rgblight_setrgb_at(0x00,0x00,0x00,8);
rgblight_setrgb_at(0x00,0x0f,0x00,9);
rgblight_setrgb_at(0x00,0x00,0x00,10);
rgblight_setrgb_at(0x00,0x00,0x00,11);
rgblight_setrgb_at(0x00,0x00,0x00,12);
rgblight_setrgb_at(0x00,0x00,0x00,13);
rgblight_setrgb_yellow_at(14);
#endif
・
・
・
The hassle of color specification that everyone will think.
"0x00, 0x00, 0x00"
So, it's easier to make a mistake than to change the color one by one.
Therefore, it seems convenient to use the colors provided.
(Even if you specify a delicate color, you will not be able to identify it with the naked eye ...)
Clone directory \ github_repository20180604 \ qmk_firmware \ quantum
rgblight_list.h
/* SET RGB List */
#define rgblight_setrgb_white() rgblight_setrgb (0xFF, 0xFF, 0xFF)
#define rgblight_setrgb_red() rgblight_setrgb (0xFF, 0x00, 0x00)
#define rgblight_setrgb_coral() rgblight_setrgb (0xFF, 0x7C, 0x4D)
#define rgblight_setrgb_orange() rgblight_setrgb (0xFF, 0x80, 0x00)
#define rgblight_setrgb_goldenrod() rgblight_setrgb (0xD9, 0xA5, 0x21)
#define rgblight_setrgb_gold() rgblight_setrgb (0xFF, 0xD9, 0x00)
#define rgblight_setrgb_yellow() rgblight_setrgb (0xFF, 0xFF, 0x00)
#define rgblight_setrgb_chartreuse() rgblight_setrgb (0x80, 0xFF, 0x00)
#define rgblight_setrgb_green() rgblight_setrgb (0x00, 0xFF, 0x00)
#define rgblight_setrgb_springgreen() rgblight_setrgb (0x00, 0xFF, 0x80)
#define rgblight_setrgb_turquoise() rgblight_setrgb (0x47, 0x6E, 0x6A)
#define rgblight_setrgb_teal() rgblight_setrgb (0x00, 0x80, 0x80)
#define rgblight_setrgb_cyan() rgblight_setrgb (0x00, 0xFF, 0xFF)
#define rgblight_setrgb_azure() rgblight_setrgb (0x99, 0xf5, 0xFF)
#define rgblight_setrgb_blue() rgblight_setrgb (0x00, 0x00, 0xFF)
#define rgblight_setrgb_purple() rgblight_setrgb (0x7A, 0x00, 0xFF)
#define rgblight_setrgb_magenta() rgblight_setrgb (0xFF, 0x00, 0xFF)
#define rgblight_setrgb_pink() rgblight_setrgb (0xFF, 0x80, 0xBF)
/* SET RGB List */
#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0xFF, at)
#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (0xFF, 0x00, 0x00, at)
#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (0xFF, 0x7C, 0x4D, at)
#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (0xFF, 0x80, 0x00, at)
#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (0xD9, 0xA5, 0x21, at)
#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (0xFF, 0xD9, 0x00, at)
#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0x00, at)
#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (0x80, 0xFF, 0x00, at)
#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x00, at)
#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x80, at)
#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (0x47, 0x6E, 0x6A, at)
#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (0x00, 0x80, 0x80, at)
#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (0x00, 0xFF, 0xFF, at)
#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (0x99, 0xf5, 0xFF, at)
#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (0x00, 0x00, 0xFF, at)
#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (0x7A, 0x00, 0xFF, at)
#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (0xFF, 0x00, 0xFF, at)
#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (0xFF, 0x80, 0xBF, at)
In case of rgblight_setrgb_ ~ ~ ~
, it is the same as how to use [Use "rgblight_setrgb" function above](#Simple light emission same color simultaneous light emission).
Replace rgblight_setrgb (0xff, 0x00, 0x00);
with rgblight_setrgb_red ();
.
In the case of rgblight_setrgb_ ~ ~ ~ _at
, it is the same as how to use [Use the above" rgblight_setrgb_at "function](#monochromatic LED individual emission).
Replace rgblight_setrgb_at (255, 255, 0, 3);
with rgblight_setrgb_yellow_at (3);
.
(I feel like the terms are not unified ...)
There is a rgblight_mode
function, and there are several patterns such as light emission only for lighting and light emission with dynamics.
It seems that there are up to 36 types, but unfortunately ErgoDoxEZ could only confirm 7 to 8 types.
I don't know because I haven't investigated it in detail, but after the 9th, it seemed to only emit the prepared light.
The light emission pattern is in the following file.
Clone directory \ github_repository20180604 \ qmk_firmware \ quantum
rgblight.c
void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) {
・
・
・
if (rgblight_config.mode == 1) {
#ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_disable();
#endif
} else if ((rgblight_config.mode >= 2 && rgblight_config.mode <= 24) ||
rgblight_config.mode == 35 || rgblight_config.mode == 36) {
// MODE 2-5, breathing
// MODE 6-8, rainbow mood
// MODE 9-14, rainbow swirl
// MODE 15-20, snake
// MODE 21-23, knight
// MODE 24, xmas
// MODE 35 RGB test
// MODE 36, alterating
・
・
・
}
Looking at this, it seems that there are "breathing" and "rainbow mood". There seems to be a program prepared for ErgoDoxEZ, but I couldn't find it again.
The usage is the same, but ...
keymap.c
case 1:
・
・
・
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb_red_at(0);
rgblight_mode(2); //← This.
#endif
・
・
・
case 2:
・
・
・
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb_yellow_at(0);
rgblight_mode(5); //← This.
#endif
・
・
・
case 3:
Questions about RGB Matrix and creating my own animations.
It seems that you need to put rgb_matrix_user.inc
in the current directory and include the header files.
I don't know what you're talking about, but it's probably useful information for those who are particular about it.
The amount of light on the front LED could be adjusted. Therefore, in the future, I would like to find out the mechanism that changes the amount of light from the LED on the back. You can change the color, but you can't change the intensity of the light.
And I want to move the color at snake or Christmas while gradually changing the light intensity from LED [0]
to LED [14]
with only one hand.
Although the priority is low.
This time, it only emitted light when changing layers. I want to make it glow when the CapsLock key is pressed.
What are the following three types !?
What is "EEPROM"?
I tried to light the LED by groping without knowing it well. I don't understand the principle of shining, but it can be considered that the purpose was achieved because it shined. Therefore, I won this time. ぉ ぉ ぉ ぉ ぉ ぉ I will continue to prioritize experience over study. As long as I am a human being, it is impossible to gain experience, but I hate studying, so I become a dog brute and try to do my best like a dog or a cow.
MechanicalKeyboards I bought the ErgoDox EZ to connect HHKB until it released the left and right separated type, but I began to think that I could start making my own ... The ‘Not So MiniDox’ Handwire : MechanicalKeyboards Challenge to build the open source self-made keyboard "Iris" Record of an inexperienced self-made keyboard assembling the left and right separated type "Orthodox" Store Keebio Domestic keyboard? Helix Keyboard Kit
You sell it everywhere. ErgoDox EZ | Split type Ergo design keyboard "ErgoDox Easy"
that's all.
Recommended Posts