This commit is contained in:
Felix Jen 2023-01-08 16:36:50 -06:00
parent 1c380c80dd
commit 2c2be57694
No known key found for this signature in database
GPG Key ID: 4E7AA63CBBCE400E
3 changed files with 35 additions and 22 deletions

View File

@ -54,20 +54,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Define RGB */
#define RGB_DI_PIN C7
#define RGBLED_NUM 36
#define RGBLED_NUM 4
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLIGHT_LIMIT_VAL 255
#define RGB_VAL_STEP 12
#define RGBLIGHT_DEFAULT_SPD 144
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL
/* #define RGBLIGHT_LAYER_BLINK*/
/* Define MIDI */
#define MIDI_ADVANCED

View File

@ -14,6 +14,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H
#include "analog.h"
#include "print.h"
#include "string.h"
enum layers {
_LAYER0,
@ -40,7 +42,7 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT_all(
QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
QK_BOOTLOADER, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_BSPC, KC_PGDN,
KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
@ -82,12 +84,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case A_CW:
if (record->event.pressed) {
midi_send_cc(&midi_device, midi_config.channel, 46, 1);
midi_send_cc(&midi_device, midi_config.channel, 90, 1);
}
return true;
case A_CCW:
if (record->event.pressed) {
midi_send_cc(&midi_device, midi_config.channel, 46, 127);
midi_send_cc(&midi_device, midi_config.channel, 90, 127);
}
return true;
default:
@ -95,20 +97,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
};
}
uint8_t last_read = 0;
/* MIDI Slider controls */
uint16_t denoise_level = 16;
uint8_t last_val = 0;
void slider(void) {
uint8_t current_read = (analogReadPin(SLIDER_PINA) +last_read) / 8; //filter strength
if (current_read != last_read ) { // (&midi_device, chan, message, highest control value - (current pin reading) >>resolution)
midi_send_cc(&midi_device, 0, 0x30, 127 - (0x7F - (analogReadPin(SLIDER_PINA) >>3 )));
uint8_t current_val = analogReadPin(SLIDER_PINA) >>3;
last_read = current_read;
if ( last_val - current_val < -1 || last_val - current_val > 1 ) {
midi_send_cc(&midi_device, 0, 90, current_val ); // (&midi_device, chan, message, highest control value - (current pin reading) >>resolution)
last_val = comp_val;
}
}
void matrix_scan_user(void) {
slider();
}

View File

@ -10,13 +10,25 @@ BOOTLOADER = atmel-dfu
# Build Options
# change yes to no to disable
#
# LTO_ENABLE = yes
# BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
# MOUSEKEY_ENABLE = yes # Mouse keys [NOTE TO SELF CHANGE TO YES]
# EXTRAKEY_ENABLE = yes # Audio control and System control [NOTE TO SELF CHANGE TO YES]
# CONSOLE_ENABLE = no # Console for debug
# COMMAND_ENABLE = no # Commands for debug and configuration
# NKRO_ENABLE = yes # Enable N-Key Rollover
# BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
# RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
# ENCODER_ENABLE = yes # Enable encoder
# MIDI_ENABLE = yes # Enable MIDI
LTO_ENABLE = yes
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys [NOTE TO SELF CHANGE TO YES]
EXTRAKEY_ENABLE = yes # Audio control and System control [NOTE TO SELF CHANGE TO YES]
CONSOLE_ENABLE = no # Console for debug
MOUSEKEY_ENABLE = no # Mouse keys [NOTE TO SELF CHANGE TO YES]
EXTRAKEY_ENABLE = no # Audio control and System control [NOTE TO SELF CHANGE TO YES]
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
NKRO_ENABLE = no # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
ENCODER_ENABLE = yes # Enable encoder