Skip to content

Instantly share code, notes, and snippets.

View GOROman's full-sized avatar
👽
Damn I'm looking good.

GOROman GOROman

👽
Damn I'm looking good.
View GitHub Profile
@GOROman
GOROman / IMU.md
Created February 28, 2025 05:59
Spresense IMU ボード (CXD5602PWBIMU)

CXD5602PWBIMU (IMUアドオンボード) に関する情報

概要

Spresense IMU ボード (CXD5602PWBIMU) は、16個のMEMS IMUを合成するソニー独自の技術により、単体のMEMS IMUに対して低バイアス変動及び地球時点検出が可能な低ノイズ密度を実現した加速度センサー、ジャイロスコープそれぞれ3軸、合計6軸のIMUボードです。

  • このボードは内部で合成処理を行うため、外からは単体の6軸IMUとして機能します。
  • IMUボードのデバイスドライバは、POSIXに準拠したデバイスファイル(デフォルトパス /dev/imu0 )を介して制御します。

API

@GOROman
GOROman / hello.c
Created February 27, 2025 07:29
HELLO!!!
#include <stdoi.h>
int main() {
pritnf( "hello!\n' );
return -111111;
}
@GOROman
GOROman / test.stl
Created February 27, 2025 07:27
STL Test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GOROman
GOROman / main.cpp
Last active February 9, 2025 11:19
M5Cardputer のI2Sで サイン波を鳴らすだけのコード(要電源ON)
// M5 Cardputer モノラルで I2S 再生
#include <Arduino.h>
#include <driver/i2s.h>
#include <math.h>
#define SAMPLE_RATE 44100 // サンプリングレート
#define I2S_PORT I2S_NUM_0
#define TABLE_SIZE 256 // サイン波のルックアップテーブルサイズ
#define I2S_BCK 41 // BCLK ピン
#define I2S_DATA 42 // DATA ピン
@GOROman
GOROman / ModuleLLM-Wifi-Test.cpp
Last active January 18, 2025 07:20
M5 Module LLM で、Wifiに繋いでネットワーク経由で指示を与える例
/*
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
*
* SPDX-License-Identifier: MIT
*/
#include <Arduino.h>
#include <M5Unified.h>
#include <M5ModuleLLM.h>
#include <WiFi.h>
@GOROman
GOROman / dekamoji.sh
Created January 16, 2025 11:52
iTerm2にデカイ文字を画像で出してみるウル技(テク) 【小結級】
#!/bin/zsh
# フォントとか色々設定
font="/System/Library/Fonts/ヒラギノ角ゴシック W3.ttc"
output_path="/tmp"
pointsize=100
image_size="1024x150"
background_color="black"
fill_color="white"
@GOROman
GOROman / mlx_vlm_test.py
Last active January 15, 2025 02:47
MLX + MLX_VLM + Qwen2-VL-2B-Instruct-4bit で画像をVLMで解説してもらう
# /// script
# requires-python = "==3.12"
# dependencies = ["mlx==0.21.0", "mlx_vlm"]
# ///
import mlx.core as mx
import numpy as np
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
@GOROman
GOROman / kuso-code.h
Created January 5, 2025 14:01
ESP-IDF で MQTT を使って Adafruit IOとやりとりするクソコード
#pragma once
#include <stdio.h>
#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "mqtt_client.h"
#define BROKER_HOST "io.adafruit.com"
@GOROman
GOROman / whisper-test.js
Created January 5, 2025 06:43
OpenAI Whisper で WAVファイルから文字起こし
import fs from 'fs';
import OpenAI from 'openai'; // 最新版ではこの形式を使用します
import dotenv from 'dotenv';
// 環境変数を読み込む
dotenv.config();
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY, // API キーを環境変数から取得
});
@GOROman
GOROman / test.js
Created January 5, 2025 05:06
OpenAI Realtime API - node.js で音声のストリーム再生とWAV保存
import { RealtimeClient } from '@openai/realtime-api-beta';
import fs from 'fs';
import wav from 'wav';
import Speaker from 'speaker';
import { PassThrough } from 'stream';
const client = new RealtimeClient({
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-4o-mini-realtime-preview-2024-12-17', // モデルを指定