Skip to content

Instantly share code, notes, and snippets.

@shikarunochi
shikarunochi / SyncPhotocellSender
Created October 8, 2018 04:19
M5Stack Sync Photocell Sender
from m5stack import lcd
import time
def drawData():
dataList = [0,0,0,0,0,0,0,0,
0,0,1,0,0,1,0,0,
0,0,1,0,0,1,0,0,
0,0,1,0,0,1,0,0,
0,0,0,0,0,0,0,0,
0,1,0,0,0,0,1,0,
@shikarunochi
shikarunochi / M5StackAnalogJoystick.py
Created October 8, 2018 13:33
M5Stack Analog Joystick
from m5stack import lcd
import utime
import machine
lcd.clear()
lcd.setCursor(0, 0)
lcd.setColor(lcd.WHITE)
switch_pin = machine.Pin(2, machine.Pin.IN, machine.Pin.PULL_UP)
@shikarunochi
shikarunochi / M5StackSpinner.ino
Created October 12, 2018 09:44
M5Stack Spinner for Arduino
#include <M5Stack.h>
#include <SD.h>
#include <Wire.h>
#include <JPEGDecoder.h>
#define PI 3.141592653589793
const int DOT_SIZE = 5;
#define SIZE_X 48
#define SIZE_Y 48
@shikarunochi
shikarunochi / removeRT.js
Last active October 19, 2018 03:02
Twitter : remove RT bookmarklet
javascript:(function(){var url=location.href;var keyword="from:" + url.substr(url.lastIndexOf("/")+1) + "%20%20-RT&f=tweets";location.href = "https://twitter.com/search?q="+ keyword;})();
@shikarunochi
shikarunochi / okiraku.ino
Last active July 17, 2019 17:10
おきらくごくらく
#include <M5Stack.h>
TFT_eSprite img = TFT_eSprite(&M5.Lcd);
int cgData[]={CYAN,0,110,0,152,51,60,44,117,112,132,109,198,156,58,162,138,211,132,201,198,257,57,271,130,319,112,319,195,-1,-1,
GREEN,0,200,0,103,29,203,41,142,89,138,99,67,137,188,139,135,184,118,196,57,232,193,246,135,319,118,319,37,-1,-1,
GREEN,0,51,0,114,99,104,117,199,174,27,194,121,319,124,319,222,-1,-1,
DARKCYAN, 0,121,0,96,22,109,35,56,47,166,55,116,68,134,83,54,85,184,100,116,125,117,147,49,148,174,162,101,183,124,193,41,208,176,217,107,233,129,252,54,257,191,271,112,319,97,319,17,-1,-1,
WHITE,0,141,0,86,59,172,89,112,156,121,169,56,206,177,229,131,319,132,319,59,-1,-1,
GREEN,0,152,0,84,83,182,100,137,223,129,228,52,319,186,319,129,-1,-1,
@shikarunochi
shikarunochi / makeMotionScript.py
Last active July 3, 2019 15:57
motionScript maker for PLEN:bit ( Microsoft MakeCode)
import sys
import os
import json
args = sys.argv
fileName = args[1]
motionFile = open(fileName, 'r')
motionJson = json.load(motionFile)
input.onButtonPressed(Button.AB, function () {
basic.pause(5000)
basic.showNumber(0)
motion00()
basic.showNumber(1)
motion01()
basic.showNumber(2)
motion02()
basic.showNumber(3)
motion03()
@shikarunochi
shikarunochi / m5stackHatGraph.ino
Created April 5, 2020 11:37
帽子のグラフ表示
//移植元はこちらです。
//https://twitter.com/yanatoku/status/1043501621030703104
//https://twitter.com/Stosstruppe/status/1245682316325740545
//https://twitter.com/Stosstruppe/status/1246383338635407365
#include <M5Stack.h>
int dt[256], db[256];
void setup(void) {
@shikarunochi
shikarunochi / efontSSD1306.h
Created April 15, 2020 09:03
Adafruit SSD1306 用 efont 表示
#ifndef __EFONT_SSD1306_H__
#define __EFONT_SSD1306_H__
#include "efont.h"
//#define EFONT_DEBUG
void printEfont(Adafruit_SSD1306 *display, char *str) {
int posX = display->getCursorX();
int posY = display->getCursorY();
@shikarunochi
shikarunochi / helloJP.ino
Created April 15, 2020 09:09
M5Atom + SSD1306 日本語表示
#include <M5Atom.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "efontEnableJa.h"
#include "efontSSD1306.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)