- Raspberry Pi 3(他のでも動くと思う)
- AS-289R2 プリンタシールド
- 配線用ジャンパケーブル少々
- Python3パッケージ
- qrcode (QRコード生成)
- serial (シリアル通信)
- WiringPi (GPIO制御など)
- imagemagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
import datetime | |
import math | |
import requests | |
import bs4 | |
""" | |
https://supernodes.nem.io/をスクレイピングしてSupernodeの一覧を格納した辞書オブジェクトとjsonオブジェクトを作ります。 | |
引数で取得件数を決められます。省略すると全部取ります。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mini_magick' | |
shiftbit = 2 | |
filename = ARGV[0] | |
bname = File.basename(filename, '.*') | |
img = MiniMagick::Image.open(filename) | |
img_width = img.width | |
img_height = img.height | |
pixels = img.get_pixels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5StickC.h> | |
#include <WiFi.h> | |
#include <time.h> | |
RTC_TimeTypeDef RTC_TimeStruct; | |
RTC_DateTypeDef RTC_DateStruct; | |
static const int JST = 3600 * 9; | |
static const char *wd[7] = {"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original https://github.com/sipeed/MaixPy_scripts/blob/master/machine_vision/demo_find_face.py | |
# for MAiX BiT | |
import sensor | |
import image | |
import lcd | |
import time | |
import KPU as kpu | |
clock = time.clock() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import (division, print_function, | |
absolute_import, unicode_literals) | |
from pytodoist import todoist | |
API_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lcd #for test | |
from machine import I2C | |
i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29) | |
lcd.init() #for test | |
lcd.draw_string(100, 100, "hello maixpy", lcd.RED, lcd.BLACK) #for test | |
i2c.writeto_mem(0x34, 0x91,b'\x70') # minimum | |
i2c.writeto_mem(0x34, 0x91,b'\xf0') # maximum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lcd | |
import utime | |
import sys | |
from machine import I2C | |
from Maix import GPIO | |
from fpioa_manager import * | |
i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29) | |
# And a short delay to wait until the I2C port has finished activating. | |
utime.sleep_ms(100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#InstallKeybdHook | |
#UseHook | |
u::4 | |
i::5 | |
o::6 | |
j::1 | |
k::2 | |
l::3 | |
p::* | |
+u::u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def output_16(q16) | |
output = <<"EOS" | |
{ "title": "#{q16}", | |
"arg": "#{q16}", | |
}, | |
{ "title": "0x#{q16}", | |
"arg": "0x#{q16}", | |
} | |
EOS | |
output |