Skip to content

Instantly share code, notes, and snippets.

View hollyhockberry's full-sized avatar

hollyhockberry

View GitHub Profile
@hollyhockberry
hollyhockberry / main.cpp
Created October 24, 2021 11:49
M5StickCPlus: IR Unit sample
#include <M5StickCPlus.h>
#include <IRsend.h>
static IRsend irsend(32);
void send(bool up) {
const uint64_t code = up ? 0x41B65DA2 : 0x41B6DD22;
for (auto i = 0; i < 4; ++i) {
irsend.sendNEC(code, 32);
::delay(70);
@hollyhockberry
hollyhockberry / main.cpp
Created October 22, 2021 11:36
M5 Fader unit: LED out 2
#include <Arduino.h>
#include <FastLED.h>
constexpr int pin_fader = 33;
constexpr int pin_led = 32;
constexpr int led_count = 14;
CRGB leds[led_count];
long show = 0;
@hollyhockberry
hollyhockberry / main.cpp
Created October 22, 2021 11:23
M5 Fader unit: LED out 1
#include <Arduino.h>
#include <FastLED.h>
constexpr int pin_fader = 33;
constexpr int pin_led = 32;
constexpr int led_count = 14;
CRGB leds[led_count];
long show = 0;
@hollyhockberry
hollyhockberry / main.cpp
Created October 22, 2021 11:09
M5 Fader unit: Fader in
#include <Arduino.h>
constexpr int pin_fader = 33;
void setup() {
Serial.begin(115200);
::pinMode(pin_fader, INPUT);
}
void loop() {
@hollyhockberry
hollyhockberry / main.cpp
Last active May 2, 2025 19:44
M5Paper: LVGL Sample (with LGFX)
#define LGFX_AUTODETECT
#define LGFX_USE_V1
#include <lvgl.h>
#include <M5EPD.h>
#include <LovyanGFX.hpp>
static const uint16_t screenWidth = 960;
static const uint16_t screenHeight = 540;
lv_disp_draw_buf_t draw_buf;
@hollyhockberry
hollyhockberry / main.cpp
Last active October 10, 2021 10:36
M5Core2: LVGL Sample (with LGFX)
#define LGFX_AUTODETECT
#define LGFX_USE_V1
#include <lvgl.h>
#include <M5Core2.h>
#include <LovyanGFX.hpp>
constexpr uint16_t screenWidth = 320;
constexpr uint16_t screenHeight = 240;
lv_disp_draw_buf_t draw_buf;
@hollyhockberry
hollyhockberry / main.cpp
Created September 29, 2021 10:05
M5Paper: Show touch position.
#include <M5EPD.h>
void setup() {
M5.begin();
}
void loop() {
if (!M5.TP.avaliable()) {
return;
}
@hollyhockberry
hollyhockberry / main.cpp
Created September 29, 2021 09:35
M5Paper: Judge touch gestures.
#include <M5EPD.h>
int lastFingers;
int eventIndex;
u_long events[4];
void pushTouchEvent(bool down) {
if (!down && (eventIndex <= 0)) {
return;
}
@hollyhockberry
hollyhockberry / main.cpp
Created September 28, 2021 10:07
M5Paper: Detection of touched points.
#include <M5EPD.h>
void setup() {
M5.begin();
}
void loop() {
if (!M5.TP.avaliable()) {
return;
}
@hollyhockberry
hollyhockberry / main.cpp
Created September 26, 2021 11:33
M5Paper: draw bitmap to fixed size with M5GFX
#include <M5EPD.h>
#include <M5GFX.h>
void setup() {
M5.begin();
M5GFX display;
display.begin();
display.invertDisplay(false);
display.clear(TFT_WHITE);