Skip to content

Instantly share code, notes, and snippets.

error[E0433]: failed to resolve: could not find `UsbEndpointType` in `web_sys`
--> /Users/mongonta555/.cargo/registry/src/index.crates.io-6f17d22bba15001f/webusb-web-0.3.0/src/lib.rs:302:22
|
302 | web_sys::UsbEndpointType::Bulk => Self::Bulk,
| ^^^^^^^^^^^^^^^ could not find `UsbEndpointType` in `web_sys`
error[E0433]: failed to resolve: could not find `UsbEndpointType` in `web_sys`
--> /Users/mongonta555/.cargo/registry/src/index.crates.io-6f17d22bba15001f/webusb-web-0.3.0/src/lib.rs:303:22
|
303 | web_sys::UsbEndpointType::Interrupt => Self::Interrupt,
@mongonta0716
mongonta0716 / SC_Config.yaml
Created February 15, 2025 14:27
bluetoothsimpleのコンフィグ
servo:
pin:
# ServoPin
# Core1 PortA X:22,Y:21 PortC X:16,Y:17
# Core2 PortA X:33,Y:32 PortC X:13,Y:14
# Stack-chanPCB Core1 X:5,Y:2 Core2 X:19,Y27
# When using SCS0009, x:RX, y:TX (not used).(StackchanRT Version:Core1 x16,y17, Core2: x13,y14)
x: 33
y: 32
offset:
@mongonta0716
mongonta0716 / builderror.txt
Created February 13, 2025 13:27
esp32-targz build error
.pio/libdeps/m5stack-fire/ESP32-targz/src/uzlib/genlz77.c:114:30: error: expected declaration specifiers or '...' before '[' token
uint32_t uzlib_checksum_none([[maybe_unused]]const void *data, [[maybe_unused]]unsigned int length, uint32_t prev_sum)
^
.pio/libdeps/m5stack-fire/ESP32-targz/src/uzlib/genlz77.c:114:64: error: expected declaration specifiers or '...' before '[' token
uint32_t uzlib_checksum_none([[maybe_unused]]const void *data, [[maybe_unused]]unsigned int length, uint32_t prev_sum)
^
.pio/libdeps/m5stack-fire/ESP32-targz/src/uzlib/genlz77.c: In function 'uzlib_deflate_init_stream':
.pio/libdeps/m5stack-fire/ESP32-targz/src/uzlib/genlz77.c:141:28: error: 'uzlib_checksum_none' undeclared (first use in this function)
ctx->checksum_cb = uzlib_checksum_none;
^~~~~~~~~~~~~~~~~~~
@mongonta0716
mongonta0716 / led.sh
Last active January 31, 2025 12:09
M5Stack ModuleLLMの/etc/rc.localでWiFiの接続を追加して、ステータスをLEDで分かるようにしたrc.local(追加部分のみ)
#!/bin/bash
# 下記のファイルを作成してください。(作成後、chmod +x /usr/local/m5stack/led.shを忘れずに)
# /usr/local/m5stack/led,sh
# 引数の数をチェック
if [ $# -ne 3 ] ; then
echo "Usage: $0 <brightness r> <brightneee g> <brigntness b>"
exit 1
fi
@mongonta0716
mongonta0716 / backup.sh
Last active January 29, 2025 14:39
M5Stack ModuleLLMの設定ファイルをバックアップとリストアするスクリプト
#!/bin/bash
# 設定ファイルをバックアップする。
# microSDカードのマウント先を指定
cd /mnt/mmcblk1p1
mkdir -p backup
cd backup
# 固定IP用の設定ファイル
cp --parents /etc/network/interfaces .
@mongonta0716
mongonta0716 / main.cpp
Last active April 2, 2025 16:14
M5Stack ModuleLLMで日本語をPC(シリアル通信)から入力し、回答をAquesTalkESP32で読み上げるサンプル。(main.cppのコメントを参照してください。)
/*
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
* SPDX-License-Identifier: MIT
* M5Stack LLM Module で日本語対話。Serial MonitorでBoth BL&CRを設定するとよいです。
* ksasaoさんのバージョンをAquesTalkで喋るようにしたバージョンです。(https://gist.github.com/ksasao/37425d3463013221e7fd0f9ae5ab1c62)
*
* --- セットアップ ---
* 1.プロジェクトにlibフォルダを作成して、そこにAquesTalkESP32のライブラリを解凍してください。(https://www.a-quest.com/download.html#a-etc)
* 2. VSCode+PlatformIOで、srcフォルダにAquesTalkのExampleにある(AquesTalkTTS_M5.cppとAquesTalkTTS.h)をコピーする必要があります。
* 3.SDカード上に"/aq_dic/aqdic_m.bin"が必要です。
#include <Arduino.h>
#include <M5Dial.h>
#include <Avatar.h>
#include "formatString.hpp"
using namespace m5avatar;
Avatar avatar;
void setup() {
@mongonta0716
mongonta0716 / formatString.hpp
Created October 19, 2024 10:58
M5DialにUnitKeyとFaderUnitを接続してAvatarの顔等を変更するサンプル
/*
see also https://stackoverflow.com/questions/7315936/which-of-sprintf-snprintf-is-more-secure/35401865#35401865
If you leave memory management to std::string, you don't have to free it yourself.
*/
// Using template
#include <string>
template<typename ...Args> std::string formatString(const char* fmt, Args... args)
{
size_t sz = snprintf(nullptr, 0U, fmt, args...); // calculate length
@mongonta0716
mongonta0716 / main.cpp
Created June 2, 2024 14:13
M5Unifed で CoreS3の液晶下部に仮想ボタンA,B,Cを配置する。(他のM5Coreとソースは共通)
#include <Arduino.h>
#include <M5Unified.h>
#include <gob_unifiedButton.hpp>
goblib::UnifiedButton unifiedButton; // gob_unifiedButton instance
void setup() {
auto cfg = M5.config();
M5.begin(cfg);
M5.Display.setTextSize(3);
@mongonta0716
mongonta0716 / main.cpp
Last active July 1, 2024 06:34
AtomS3Liteで、Windowsログインするプログラム(セキュリティには注意しましょう)
#include <Arduino.h>
#include "USB.h"
#include "USBHIDKeyboard.h"
#include "USBHIDMouse.h"
#include <M5Unified.h>
#include <FastLED.h>
USBHIDKeyboard keyboard;
USBHIDMouse mouse;
void setup() {