Skip to content

Instantly share code, notes, and snippets.

@mongonta0716
mongonta0716 / fugu.py
Last active May 26, 2020 05:02
M5StickV _thread test
import video,time,lcd
from Maix import I2S, GPIO
from fpioa_manager import *
import lcd
import uos
import sys
import pmu
import image
import audio
from machine import I2C
@mongonta0716
mongonta0716 / 8bitbmp_to_4bitbmp.sh
Created April 3, 2020 04:47
ImageMagickを使って8bit bmpから4bit bmpへ一括変換するシェル。colorpalette.pngは16色のカラーパレット情報を持ったpngファイル
#!/bin/bash
if [ "$1" = "" ]
then
echo "引数にリストファイルを指定してください"
exit
fi
for i in $(cat $1)
do
@mongonta0716
mongonta0716 / SpriteTest.ino
Last active April 15, 2020 06:35
Comparison of LovyanGFX and M5StackLibrary
// 基本的な使い方
// ヘッダをincludeします。
//#include <LovyanGFX.hpp>
#include <M5Stack.h>
// 対応機種をArduino環境で使う場合は、特別な設定は不要です。
static M5Display lcd; // LGFXのインスタンスを作成。
static TFT_eSprite sprite(&lcd); // スプライトを使う場合はLGFX_Spriteのインスタンスを作成。
@mongonta0716
mongonta0716 / 2_spi_setting
Created April 16, 2020 08:10
LovyanGFX Sample for 1.3 inch ST7789 LCD(240x240)
// LovyanGFX SPIバスおよび使用パネルの設定を伴う使い方
// ヘッダをincludeします。
#include <LovyanGFX.hpp>
// SPI設定用の構造体を用意します。
// 構造体の名称に決まりはありませんが、
// 構造体の各メンバ変数の名前と型は例の通りにしてください。
struct LGFX_Config {
@mongonta0716
mongonta0716 / raspi_diagnostics.txt
Created April 23, 2020 11:35
Raspi4B diagnostics
●①Raspberry Pi 4B-2GB micron 32GB with fan
Raspberry Pi Diagnostics - version (unknown)
Thu Apr 23 20:20:49 2020
Test : SD Card Speed Test
Run 1
prepare-file;0;0;19354;37
seq-write;0;0;21779;42
rand-4k-write;0;0;3661;915
#include <Arduino.h>
#include "FreeRTOS.h"
#include "task.h"
#include <bsp.h>
#include <sysctl.h>
#define MP_TASK_PRIORITY 4
#define MP_TASK_STACK_SIZE (32 * 1024)
#define MP_TASK_STACK_LEN (MP_TASK_STACK_SIZE / sizeof(StackType_t))
TaskHandle_t mp_main_task_handle0;
@mongonta0716
mongonta0716 / sprite_test.ino
Created May 14, 2020 03:52
スプライトの最大数を調査するためのサンプル(Investigate the maximum number of sprites.)
// スプライトの最大数調査用サンプル
// 使い方
// 下記の変数を変えることにより、使用可能なSpriteの最大数を調べることができます。
// ・MAX_SPRITE 表示したいスプライトの数
// ・sprite_w スプライトの幅
// ・sprite_h スプライトの高さ
// ・color_depth スプライトのカラー深度
// ●PSRAMを使う場合
// ・use_psramをtrueにしてください。
#include <M5Atom.h>
#include <driver/i2s.h>
#include "AquesTalkTTS.h"
#include "driver/dac.h"
#define CONFIG_I2S_BCK_PIN 19
#define CONFIG_I2S_LRCK_PIN 33
#define CONFIG_I2S_DATA_PIN 22
#define CONFIG_I2S_DATA_IN_PIN 23
@mongonta0716
mongonta0716 / M5StickC_WiFi_Test.ino
Created June 25, 2020 06:42
WiFi Test for M5StickC
#include <M5StickC.h>
#include <WiFi.h>
const char ssid[] = "ssid";
const char pass[] = "pass";
void setup() {
M5.begin();
M5.Lcd.init();
M5.Lcd.setRotation(3);
@mongonta0716
mongonta0716 / reciever.sh
Last active July 7, 2020 07:55
Gstreamer audio via udp sample
#!/bin/bash
# XXX.XXX.XXX.XXX is own IP address
gst-launch-1.0 -v udpsrc uri=udp://XXX.XXX.XXX.XXX:5555 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)44100,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! autoaudiosink sync=false