Skip to content

Instantly share code, notes, and snippets.

View hasumikin's full-sized avatar
🐕‍🦺
inu

HASUMI Hitoshi hasumikin

🐕‍🦺
inu
View GitHub Profile

clone template

git clone https://github.com/hasumikin/mrubyc-template-posix.git 02
cd 02

edit source

  • create mrblib/loops/master.rb
  • create mrblib/models/greeter.rb
  • edit main.c (you can replace whole of the file with code below)

clone template

git clone https://github.com/hasumikin/mrubyc-template-esp32.git 03
cd 03

edit source

  • create mrblib/loops/master.rb
  • create mrblib/models/greeter.rb
  • edit main/main.c (you can replace whole of the file with code below)

wire a breadboard

breadboard

clone template

git clone https://github.com/hasumikin/mrubyc-template-esp32.git 04
cd 04

edit source

wire a breadboard

breadboard

clone template

git clone https://github.com/hasumikin/mrubyc-template-esp32.git 05
cd 05

edit source

copy sample project from esp exapmples

cp -r $IDF_PATH/examples/get-started/hello_world $HOME/esp
cd $HOME/esp/hello_world
make

build, flash and run

make
@hasumikin
hasumikin / keymap.rb
Last active April 8, 2021 11:11
PRK Firmware — A keyboard firmware with PicoRuby on Raspberry Pi Pico
# This example assumes to use "meishi2" which has 2x2 matrix circuit.
#
# If you use a larger one, let's say 40% keyboard, the code will look like:
# (Note that GPIO pin numbers in this example are written at random. They are fishy)
# ```
# kbd = Keyboard.new(
# [ 2, 3, 4, 5 ], # row0, row1,... respectively
# [ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ] # col0, col1,... respectively
# )
# kbd.add_layer :default, [
@hasumikin
hasumikin / keymap.rb
Created February 6, 2022 23:35
Shotgun CherryPie example keymap
kbd = Keyboard.new
kbd.init_pins(
[ 11, 12, 13, 14, 15 ], # row0, row1,... respectively
[ 9, 8, 7, 6 ] # col0, col1,... respectively
)
kbd.add_layer :default, %i[
RGB_TOG KC_ESC KC_NO KC_BSPACE
RGB_MOD KC_7 KC_8 KC_9
@hasumikin
hasumikin / keymap.rb
Last active March 2, 2022 14:39
keymap.rb of Amatelus73
kbd = Keyboard.new
c1 = 29
c2 = 28
c3 = 27
c4 = 26
c5 = 22
c6 = 20
c7 = 23
c8 = 21
@hasumikin
hasumikin / keymap.rb
Created May 6, 2022 02:51
Simulating "Grave Escape" feature of QMK
class Keyboard
def grave_escape
index = @keycodes.index(KEYCODE.index(:KC_ESCAPE).chr)
if index
if (@modifier & 0b00010001) > 0 # CTRL
# Do nothing so that "SHIFT+CTRL+ESCAPE" opens Task Manager
elsif (@modifier & 0b00100010) > 0 # SHIFT
@keycodes[index] = KEYCODE.index(:KC_GRAVE).chr
elsif (@modifier & 0b10001000) > 0 # GUI
@keycodes[index] = KEYCODE.index(:KC_GRAVE).chr