~ruther/qmk_firmware

ref: 7a411014c94fe1b6e90f4981b1690341ed59aba5 qmk_firmware/keyboards/xelus/valor/rev2/rgb_matrix_kb.inc -rw-r--r-- 924 bytes
7a411014 — Rutherther feat: few updates 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Step 1.
// Declare custom effects using the RGB_MATRIX_EFFECT macro
// (note the lack of semicolon after the macro!)
RGB_MATRIX_EFFECT(test_mode)

// Step 2.
// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

// e.g: A simple effect, self-contained within a single method
static bool test_mode(effect_params_t* params) {
    uint8_t factor = 9;
    switch ((g_rgb_timer & (0b11 << factor)) >> factor) {
        case 0: {
            rgb_matrix_set_color_all(150, 0, 0);
            break;
        }
        case 1: {
            rgb_matrix_set_color_all(0, 150, 0);
            break;
        }
        case 2: {
            rgb_matrix_set_color_all(0, 0, 150);
            break;
        }
        case 3: {
            rgb_matrix_set_color_all(150, 150, 150);
            break;
        }
    }
    return false;
}

#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
Do not follow this link