Skip to content

Instantly share code, notes, and snippets.

@eswai
eswai / Microphone.ino
Created September 16, 2023 12:26
M5Stick C Plus版
/*
* M5Stick C PlusでSAMPLING_FREQUENCYでマイクを測定し、FFTして周波数成分をLCDにグラフ表示。
* https://ambidata.io/samples/m5stack/sound/
*/
#include <M5StickCPlus.h>
#include "arduinoFFT.h"
#define MIC 33
#define SAMPLING_FREQUENCY 40000
@eswai
eswai / Microphone.ino
Created September 16, 2023 11:26
M5StackでSAMPLING_FREQUENCYでマイクを測定し、FFTして周波数成分をLCDにグラフ表示。
/*
* M5StackでSAMPLING_FREQUENCYでマイクを測定し、FFTして周波数成分をLCDにグラフ表示。
* https://ambidata.io/samples/m5stack/sound/
*/
#include <M5Core2.h>
#include "arduinoFFT.h"
#define MIC 33
#define SAMPLING_FREQUENCY 40000
{
"title": "Unicode Hex Input Switcher",
"rules": [
{
"description": "Switchi Input Source between Unicode Hex Input ane Japanese",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "h",
def rmkdir(d)
begin
Dir::mkdir(d)
rescue
rmkdir(d.gsub(/\/[^\/]+?$/, ''))
Dir::mkdir(d)
end
end
Dir::glob("/Users/hoge/Music/FLAC/**/*.flac").each {|inf|
# JSPORTSサイクルロードレースの放送予定をicalで出力する
require 'nokogiri'
require 'open-uri'
require 'icalendar'
require 'digest'
def parseDate(str)
r = []
d = str.scan(/(\d+)月(\d+)日/).flatten
@eswai
eswai / Dockerfile
Created December 18, 2021 03:59
Dockerfile for PRK firmware without keymap
FROM ruby:3.0.1-slim AS build
RUN apt-get update && apt-get install --no-install-recommends -y \
cmake \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi \
libstdc++-arm-none-eabi-newlib \
ca-certificates \
git \
gcc \
class KyuriKai
def pressed(keycode)
# true: continue the following steps, false: skip the following steps and jump to the next loop
true or false
end
def released(keycode)
true or false
end
end
@eswai
eswai / keymap.rb
Last active December 10, 2021 22:00
PRK firmware keymap for Vpico x Kyuri-Kai
# Initialize a Keyboard
kbd = Keyboard.new
# Initialize GPIO assign
kbd.init_pins(
[ 7, 8, 9, 10 ],
[ 15, 14, 13, 12, 11, 20, 19, 18, 17, 16]
)
# +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------