Skip to content

Instantly share code, notes, and snippets.

View hollyhockberry's full-sized avatar

hollyhockberry

View GitHub Profile
@hollyhockberry
hollyhockberry / main.cpp
Last active January 5, 2024 12:18
fm-chan #スタックチャン
// Copyright (c) 2024 Inaba (@hollyhockberry)
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
#include <M5Unified.h>
#include <Avatar.h>
using m5avatar::BoundingRect;
using m5avatar::DrawContext;
using m5avatar::Eye;
@hollyhockberry
hollyhockberry / main.cpp
Created December 19, 2023 01:11
回り込みサンプルその2
#include <M5Unified.h>
#include <Avatar.h>
using namespace m5avatar;
namespace {
M5Canvas asset;
// 回り込みするパーツのサンプル
@hollyhockberry
hollyhockberry / main.cpp
Created December 19, 2023 00:30
回り込みサンプル
#include <M5Unified.h>
M5Canvas canvas, asset;
void setup() {
M5.begin();
canvas.setColorDepth(1);
canvas.createSprite(320, 240);
@hollyhockberry
hollyhockberry / main.cpp
Created November 19, 2023 22:57
Sample to check behavior of native env.
#include <M5Unified.h>
M5Canvas sprite;
void setup() {
M5.begin();
sprite.createSprite(120, 120);
sprite.drawCircle(sprite.width() >> 1, sprite.height() >> 1, sprite.width() >> 2, RED);
sprite.drawRect(0, 0, sprite.width() - 1, sprite.height() - 1, RED);
@hollyhockberry
hollyhockberry / main.cpp
Created October 24, 2023 09:32
M5Dial + Unit IR Sample
// Copyright (c) 2023 Inaba (@hollyhockberry)
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
#include <M5Unified.h>
#include <driver/pcnt.h>
#include <IRsend.h>
#include <IRrecv.h>
#include <limits>
@hollyhockberry
hollyhockberry / main.cpp
Created October 7, 2023 12:04
GLASS2 with M5ATOM-S3
#include <M5UnitGLASS2.h>
M5UnitGLASS2 display (2, 1, 400000);
constexpr size_t POINTS = 128;
int points[POINTS];
void setup() {
display.init();
display.startWrite();
display.fillScreen(TFT_BLACK);
@hollyhockberry
hollyhockberry / main.cpp
Last active June 5, 2023 11:01
Sample: Porting LovyanGFX to 'Seeed Studio Round Display for XIAO' with XIAO ESP32S3
#include <math.h>
#include <Arduino.h>
#define LGFX_USE_V1
#include <SPIFFS.h>
#include <LovyanGFX.hpp>
namespace {
struct Touch_XiaoRound : public lgfx::v1::ITouch {
Touch_XiaoRound() {
@hollyhockberry
hollyhockberry / server.py
Created May 20, 2023 06:45
py: Show POST request header and body.
import http.server
class handler(http.server.BaseHTTPRequestHandler):
def do_POST(self):
""" show request header """
print()
print('=== POST REQUEST HEADER ===')
print(self.headers)
content_length = self.headers.get("content-length")
@hollyhockberry
hollyhockberry / main.cpp
Last active May 22, 2023 00:14
Sample: Using Whisper API with M5 CoreS3
// Copyright (c) 2023 Inaba (@hollyhockberry)
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
#include <SD.h>
#include <M5Unified.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <gob_unifiedButton.hpp>
@hollyhockberry
hollyhockberry / picocaptouch.py
Created November 13, 2022 11:47
py: Pico-CapTouch-ePaper-2.9 on Circuit Python
import time
import board
import busio
import digitalio
import displayio
_START_SEQUENCE = (
b"\x12\x80\x14" # soft reset and wait 20ms
b"\x11\x01\x03" # Ram data entry mode
b"\x3C\x01\x05" # border color