Skip to content

Instantly share code, notes, and snippets.

@Harry-Harrison
Created September 25, 2020 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Harry-Harrison/3711545549a9e4e667327caee2164c9b to your computer and use it in GitHub Desktop.
Save Harry-Harrison/3711545549a9e4e667327caee2164c9b to your computer and use it in GitHub Desktop.
#pragma once
#include "config_common.h"
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x3003
#define DEVICE_VER 0x0001
#define MANUFACTURER _MSA
#define PRODUCT StripLamp
#define DESCRIPTION Lamp
#define MATRIX_ROWS 1
#define MATRIX_COLS 2
#define DIODE_DIRECTION COL2ROW
#define MATRIX_ROW_PINS { B0 }
#define MATRIX_COL_PINS { F4, F5 }
#define ENCODERS_PAD_A { D1, D4 }
#define ENCODERS_PAD_B { D0, C6 }
#define DEBOUNCE 5
#define RGB_DI_PIN D3
#define UNUSED_PINS
// #define RGBLIGHT_ANIMATIONS
#undef RGBLED_NUM
#define RGBLED_NUM 93
#define RGBLIGHT_LIMIT_VAL 255
// 5 steps for saturation control
#define RGBLIGHT_HUE_STEP 10
// 5 steps for saturation control
#define RGBLIGHT_SAT_STEP 51
// 5 Steps for brightness control
#define RGBLIGHT_VAL_STEP 51
#include QMK_KEYBOARD_H
/* LAYER 1
* /-------+-------\
* |RGB_TOG|RGB_MOD|
* \-------+-------/
*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(RGB_TOG, RGB_MOD) \
};
void encoder_update_user(uint8_t index, _Bool clockwise) {
if (index == 0) {
if (clockwise) {
rgblight_increase_val();
} else {
rgblight_decrease_val();
}
}
else if (index == 1) {
if (clockwise) {
rgblight_increase_hue();
} else {
rgblight_decrease_hue();
}
}
}
MCU = atmega32u4
BOOTLOADER = atmel-dfu
OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays
ENCODER_ENABLE = yes # Enables the use of one or more encoders
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
SLEEP_LED_ENABLE = no
Link_Time_Optimization = yes # Reduce size of firmware by optimizing at link time
EXTRAFLAGS += -flto
#include "striplamp.h"
#pragma once
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
//rgb led driver
#include "ws2812.h"
#endif
#define LAYOUT( \
KA1, KA2 \
) \
{ \
{ KA1, KA2 } \
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment