Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Add "Uno" rev2 #14071

Merged
merged 22 commits into from
Mar 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1e22b07
[Keyboard] Add "Uno" rev2
Snipeye Aug 19, 2021
16023b0
Merge branch 'master' into unorev2
spencer-p Sep 6, 2021
a4c6921
Update keyboards/uno/rev2/rules.mk
spencer-p Sep 16, 2021
c8435df
Update keyboards/uno/rev1/rules.mk
spencer-p Sep 16, 2021
21d20a7
Update keyboards/uno/uno.h
spencer-p Sep 16, 2021
e7262fd
Merge branch 'master' into unorev2
spencer-p Sep 16, 2021
5d0c943
Update keyboards/uno/rev2/rules.mk
spencer-p Nov 6, 2021
200bf32
Update keyboards/uno/rev1/rules.mk
spencer-p Nov 6, 2021
8324c5d
Update keyboards/uno/keymaps/demo/keymap.c
spencer-p Nov 6, 2021
11cfb2d
Update keyboards/uno/keymaps/demo/keymap.c
spencer-p Nov 6, 2021
d492ffd
Update keyboards/uno/keymaps/demo/keymap.c
spencer-p Nov 6, 2021
3171cdb
Merge branch 'master' of github.com:qmk/qmk_firmware into unorev2
spencer-p Dec 14, 2021
cfd1d4d
Merge branch 'unorev2' of github.com:spencer-p/qmk_firmware into unorev2
spencer-p Dec 14, 2021
00de3de
Update keyboards/uno/rev2/rules.mk
spencer-p Dec 14, 2021
4954d11
Update keyboards/uno/rev1/rules.mk
spencer-p Dec 14, 2021
c04a3ed
Align rules.mk comments
spencer-p Jan 7, 2022
0a42b4e
Update keyboards/uno/info.json
spencer-p Mar 11, 2022
c993246
Update keyboards/uno/rev1/config.h
spencer-p Mar 11, 2022
6bb6d58
Update keyboards/uno/rev2/config.h
spencer-p Mar 11, 2022
7eb82c9
Update keyboards/uno/rev2/config.h
spencer-p Mar 11, 2022
8ce1573
Update keyboards/uno/rev2/config.h
spencer-p Mar 11, 2022
c28aad6
Update keyboards/uno/rev1/config.h
spencer-p Mar 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 3 additions & 51 deletions keyboards/uno/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xACC8
#define DEVICE_VER 0x0001
#define MANUFACTURER Broekhuijsen
#define PRODUCT Uno

/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 1

/* Uno default pinout */
#define DIRECT_PINS { \
{ B6 } \
}
#define UNUSED_PINS

#define RGB_DI_PIN F6
#ifdef RGB_DI_PIN
#define RGBLED_NUM 1
// #define RGBLIGHT_HUE_STEP 32
// #define RGBLIGHT_SAT_STEP 32
// #define RGBLIGHT_VAL_STEP 32
// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
// /*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #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
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
#endif
#pragma once

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
#include "config_common.h"

/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
// See rev1/config.h and rev2/config.h to configure your uno.
85 changes: 85 additions & 0 deletions keyboards/uno/keymaps/copypasta/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/* Copyright 2020 Snipeye
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

enum uno_keycode
{
UNO = SAFE_RANGE
};

static uint16_t pressTimer = 0xFFFF;
#define CUSTOM_LONGPRESS 1000
#define PASTA_COUNT 4

const char *pasta[PASTA_COUNT] = {
"Hey - I'm Uno... V2. This time, I have uno more features: I support a rotary encoder, too. That's it. That's the only difference.",
"Did you ever hear the tragedy of Darth Plagueis the Wise? I thought not. It's not a story the Jedi would tell you. It's a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life... He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful... the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic, he could save others from death, but not himself.",
"The intent is to provide players with a sense of pride and accomplishment for unlocking different heroes. As for cost, we selected initial values based upon data from the Open Beta and other adjustments made to milestone rewards before launch. Among other things, we're looking at average per-player credit earn rates on a daily basis, and we'll be making constant adjustments to ensure that players have challenges that are compelling, rewarding, and of course attainable via gameplay. We appreciate the candid feedback, and the passion the community has put forth around the current topics here on Reddit, our forums and across numerous social media outlets. Our team will continue to make changes and monitor community feedback and update everyone as soon and as often as we can.",
"The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start.",
};

uint8_t pastaIndex = 0;

enum encoder_names {
_ENCODER,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
UNO
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case UNO:
if (record->event.pressed) {
pressTimer = timer_read();
} else {
uint16_t timeElapsed = timer_elapsed(pressTimer);
if (timeElapsed < CUSTOM_LONGPRESS) {
send_string(pasta[pastaIndex]);
} else {
reset_keyboard();
}
}
break;
}
return false;
}

void keyboard_post_init_user(void) {
rgblight_enable_noeeprom();
rgblight_sethsv_noeeprom(0, 255, 255);
rgblight_mode_noeeprom(1);
//rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
}

void encoder_update_user(uint8_t index, bool clockwise) {
if (index == _ENCODER) { /* First encoder */
if (clockwise) {
pastaIndex++;
pastaIndex %= PASTA_COUNT;
} else {
pastaIndex += PASTA_COUNT;
pastaIndex--;
pastaIndex %= PASTA_COUNT;
}
rgblight_sethsv_noeeprom((255/PASTA_COUNT)*pastaIndex, 255, 255);
rgblight_mode_noeeprom(1);
}
}
4 changes: 4 additions & 0 deletions keyboards/uno/keymaps/copypasta/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# A copypasta keymap for uno
![Picture](https://i.imgur.com/OqPyWbbl.jpg)

[A demo of this keymap can be found here.](https://www.reddit.com/r/MechanicalKeyboards/comments/k7w1j1/qmk_is_a_pathway_to_many_abilities_some_consider/)
89 changes: 25 additions & 64 deletions keyboards/uno/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,17 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

enum uno_keycode
{
UNO = SAFE_RANGE
};

static uint16_t pressTimer = 0xFFFF;
#define CUSTOM_LONGPRESS 150
#define CUSTOM_LONGERPRESS 750
#define CUSTOM_STRING "I can put a whole buncha text in here and type it all with a single keypress."
#define RESET_LENGTH 3000
const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 10, 25, 50 };

char stringToSend[2] = "a";
char maxLetter = 'z';

uint8_t presetCounter = 0;

#define COUNTER X_A

enum encoder_names {
_ENCODER,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
Expand All @@ -44,59 +34,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case UNO:
if (record->event.pressed) {
pressTimer = timer_read();
} else {
uint16_t timeElapsed = timer_elapsed(pressTimer);
switch (presetCounter) {
case 0:
SEND_STRING(SS_LCMD("n"));
break;
case 1:
SEND_STRING("Hello!");
break;
case 2:
SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"I am uno!");
break;
case 3:
SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"I can do all sorts of useless things!");
break;
case 4:
SEND_STRING(SS_TAP(X_ENTER)SS_TAP(X_ENTER)"And I have a built-in RGB LED!"SS_TAP(X_ENTER)SS_TAP(X_ENTER)SS_TAP(X_ENTER));
rgblight_sethsv_noeeprom(255, 255, 255);
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
break;
default:
if (timeElapsed < CUSTOM_LONGPRESS) {
// Normal press. We're going to send the current letter and increment the counter.
SEND_STRING(SS_TAP(X_BSPACE));
send_string(stringToSend);
stringToSend[0]++;
if (stringToSend[0] > maxLetter) {
stringToSend[0] = 'a';
}
} else if (timeElapsed < CUSTOM_LONGERPRESS) {
// Long press, confirm the current letter, reset counter
stringToSend[0] = 'a';
send_string(stringToSend);
} else if (timeElapsed < RESET_LENGTH) {
// Longer press, display macro.
SEND_STRING(CUSTOM_STRING);
} else {
reset_keyboard();
}
presetCounter--;
break;
}
presetCounter++;
}
break;
if (record->event.pressed) {
SEND_STRING("Hello!");
}
break;
return false;
}
return false;
return true;
}

void keyboard_post_init_user(void) {
rgblight_enable_noeeprom();
rgblight_sethsv_noeeprom(0, 0, 0);
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom(255, 255, 255);
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
}

bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == _ENCODER) { /* First encoder */
if (clockwise) {
tap_code(KC_A);
} else {
tap_code(KC_B);
}
return false;
}
return true;
}

5 changes: 3 additions & 2 deletions keyboards/uno/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# The default keymap for uno
![Keymap](https://i.imgur.com/lCPZZpO.png)
![Picture](https://i.imgur.com/OqPyWbbl.jpg)

The 'Macro' key does a few things: If you open up textedit (was made for a mac), it sends "Command+n" for the first press to make a new document. It then types a few different messages, activates the RGB LED, and finally ends in a "scroll through the alphabet with a long press to confirm a certain character" keyboard mode.
This keymap types "Hello!" when pressed and presses 'A' and 'B' when turning the
encoder.
123 changes: 123 additions & 0 deletions keyboards/uno/keymaps/demo/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/* Copyright 2020 Snipeye
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

enum uno_keycode
{
UNO = SAFE_RANGE
};

static uint16_t pressTimer = 0xFFFF;
#define CUSTOM_LONGPRESS 150
#define CUSTOM_LONGERPRESS 750
#define CUSTOM_STRING "I can put a whole buncha text in here and type it all with a single keypress."
#define RESET_LENGTH 3000
const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 10, 25, 50 };

char stringToSend[2] = "a";
char maxLetter = 'z';

uint8_t presetCounter = 0;

#define COUNTER X_A

enum encoder_names {
_ENCODER,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
UNO
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case UNO:
if (record->event.pressed) {
pressTimer = timer_read();
} else {
uint16_t timeElapsed = timer_elapsed(pressTimer);
switch (presetCounter) {
case 0:
SEND_STRING(SS_LCMD("n"));
break;
case 1:
SEND_STRING("Hello!");
break;
case 2:
SEND_STRING("\n\nI am uno!");
break;
case 3:
SEND_STRING("\n\nI can do all sorts of useless things!");
break;
case 4:
SEND_STRING("\n\nAnd I have a built-in RGB LED!\n\n\n");
rgblight_sethsv_noeeprom(255, 255, 255);
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
break;
default:
if (timeElapsed < CUSTOM_LONGPRESS) {
// Normal press. We're going to send the current letter and increment the counter.
SEND_STRING(SS_TAP(X_BSPACE));
send_string(stringToSend);
stringToSend[0]++;
if (stringToSend[0] > maxLetter) {
stringToSend[0] = 'a';
}
} else if (timeElapsed < CUSTOM_LONGERPRESS) {
// Long press, confirm the current letter, reset counter
stringToSend[0] = 'a';
send_string(stringToSend);
} else if (timeElapsed < RESET_LENGTH) {
// Longer press, display macro.
SEND_STRING(CUSTOM_STRING);
} else {
reset_keyboard();
}
presetCounter--;
break;
}
presetCounter++;
}
break;
}
return false;
}

void keyboard_post_init_user(void) {
rgblight_enable_noeeprom();
rgblight_sethsv_noeeprom(0, 0, 0);
rgblight_mode(1);
// Uncomment to enable rainbow mode when plugged in.
// Otherwise, the LED will be revealed after a few keypresses.
//rgblight_sethsv_noeeprom(255, 255, 255);
//rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD);
}

bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == _ENCODER) { /* First encoder */
if (clockwise) {
tap_code(KC_A);
} else {
tap_code(KC_B);
}
return false;
}
return true;
}

Loading