Skip to content

Instantly share code, notes, and snippets.

@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)
@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 / 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 / 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 / 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 / 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 / SyncPhotocellReceiver
Created October 8, 2018 04:12
M5Stack Sync Photocell Reveiver
from m5stack import lcd
import time
import machine
lcd.clear()
lcd.setCursor(0, 0)
lcd.setColor(lcd.WHITE)
dataPin = machine.ADC(machine.Pin(36, machine.Pin.IN))
dataPin.atten(machine.ADC.ATTN_11DB)
@shikarunochi
shikarunochi / PhotocellSender.py
Created October 8, 2018 04:03
M5Stack Photocell Sender
from m5stack import lcd
import time
lcd.clear()
lcd.setColor(lcd.WHITE)
count = 0
while True:
if count == 0:
lcd.clear(lcd.WHITE)
@shikarunochi
shikarunochi / PhotocellReceiver.py
Created October 8, 2018 03:39
M5Stack Photocell Receiver
from m5stack import lcd
import utime
import machine
lcd.clear()
lcd.setCursor(0, 0)
lcd.setColor(lcd.WHITE)
pin = machine.ADC(machine.Pin(35, machine.Pin.IN))
pin.atten(machine.ADC.ATTN_11DB)
from m5stack import lcd
import time
fontDataDict = {
"0":[0x0000,0x0E00,0x1100,0x2080,0x2080,0x2080,0x2080,0x2080,0x2080,0x1100,0x0E00,0x0000,0x0000],
"1":[0x0000,0x0400,0x0C00,0x1400,0x2400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0000,0x0000],
"2":[0x0000,0x0E00,0x1100,0x2080,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x3F80,0x0000,0x0000],
"3":[0x0000,0x3F80,0x0100,0x0200,0x0400,0x0E00,0x0100,0x0080,0x2080,0x1100,0x0E00,0x0000,0x0000],
"4":[0x0000,0x0600,0x0A00,0x0A00,0x1200,0x1200,0x2200,0x2200,0x7F80,0x0200,0x0200,0x0000,0x0000],
"5":[0x0000,0x3F80,0x2000,0x2000,0x2E00,0x3100,0x0080,0x0080,0x0080,0x2100,0x1E00,0x0000,0x0000],