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
# M5StackのCM4Stackを使って出退勤記録ボタンのようなものを作る | |
# このスクリプトはボタンだけで、別途用意したSubmitSyukkin.py, SubmitTaikin.py | |
# を起動する。CM4StackではSeleniumなども動くので幅広く応用できるかも。 | |
import sys | |
import os | |
import time | |
import subprocess | |
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton | |
from PyQt5.QtCore import Qt, QTimer |
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 <PowerFunctions.h> | |
PowerFunctions pf(9, 0); | |
#define RED_BUTTON 32 | |
#define BLUE_BUTTON 33 | |
#define ButtonA 37 | |
void setup() { |
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 "M5Atom.h" | |
#include "FastLED.h" | |
#include "pixeltypes.h" | |
// Fader Unit connected to Grove port of M5Atom Lite | |
#define NUM_LEDS_FADER 14 | |
#define DATA_PIN_FADER 26 | |
#define INPUT_PINS 32 | |
// Define the array of leds | |
CRGB leds[NUM_LEDS_FADER]; |
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 "M5Atom.h" | |
#include "FastLED.h" | |
#include "pixeltypes.h" | |
// Fader Unit connected to Grove port of M5Atom Lite | |
#define NUM_LEDS_FADER 14 | |
#define DATA_PIN_FADER 26 | |
#define INPUT_PINS 32 | |
// Define the array of leds | |
CRGB leds[NUM_LEDS_FADER]; |
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
[pi4] | |
disable_fw_kms_setup=1 | |
max_framebuffers=2 | |
disable_overscan=1 | |
dtoverlay=vc4-fkms-v3d | |
hdmi_force_hotplug=1 | |
boot_delay | |
kernel=vmlinuz | |
initramfs initrd.img followkernel | |
gpu_mem=512 |
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 <M5Atom.h> | |
#include <WiFi.h> | |
#include <SinricPro.h> | |
#include <SinricProMotionsensor.h> | |
#define WIFI_SSID "YOUR_SSID" | |
#define WIFI_PASS "YOUR_WIFIPASS" | |
#define APP_KEY "YOUR_APPKEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx" | |
#define APP_SECRET "YOUR_APP_SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx" | |
#define MOTIONSENSOR_ID "YOUR_DEVICEID" // Should look like "5dc1564130xxxxxxxxxxxxxx" |
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
// Display electronic power consumption meter value recieved by | |
// M5StickC Wi-SUN Hat ( https://kitto-yakudatsu.com/archives/7206 ) | |
// via ESPNow | |
#include <TM1630LED.h> | |
#include <esp_now.h> | |
#include <WiFi.h> | |
#define CHANNEL 6 // Use Same Wi-Fi channel as M5StickC+Wi-SUN Hat uses. |
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
# Control SwitchBot with M5Atom+PIR sensor unit | |
# Many thanks to https://tech.fusic.co.jp/posts/2020-04-01-switchbot-with-m5stack/ | |
#include <M5Atom.h> | |
#include "BLEDevice.h" | |
#define SWITCHBOT_MAC "XX:XX:XX:XX:XX:XX" | |
static BLEUUID serviceUUID("CBA20D00-224D-11E6-9FB8-0002A5D5C51B"); | |
static BLEUUID characteristicUUID("CBA20002-224D-11E6-9FB8-0002A5D5C51B"); | |
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
const m5 = require('m5stickcjs'); | |
var obniz = new m5("XXXXXXXX"); | |
obniz.onconnect = async function () { | |
// lcd = obniz.wired('ST7735S', { mosi: 15, sclk: 13, dc: 23, res:18, cs:5}); | |
lcd = obniz.m5display; | |
await lcd.onWait(); | |
console.log(lcd.width); //128 | |
console.log(lcd.height); //160 | |
lcd.setRotation(1); |
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
--- | |
title: "Rでe-Statの統計表から都道府県別SMRを描く" | |
output: html_document | |
--- | |
このテキストでは、政府統計e-StatのAPIを使って、Rに直接統計表を読み込み、それを処理して特定の疾患(ICD-10に基づいた死因簡単分類で指定)の都道府県別の標準化死亡比(Standard Mortality Ratio, SMR)を算出し、その値によって都道府県を塗り分けた地図をかいてみます。すべてRの中だけで完結し、またプログラムの長さも短くて済んでいることに注目してください。 | |
```{r, echo=FALSE, results='hide'} | |
appId <- "0000000000000000000000000000000000000000" |
NewerOlder