Skip to content

Instantly share code, notes, and snippets.

View ma2shita's full-sized avatar

Kohei MATSUSHITA ma2shita

View GitHub Profile
import os
import json
import urllib.request
import urllib.parse
SLACK_CHANNEL_ID = os.environ['SLACK_CHANNEL_ID']
def lambda_handler(event, _):
print(f'{event=}')
btn = event['deviceEvent']['buttonClicked']['clickType']
text = f'ボタンが「{btn}」で押されました。<@UC0RVEWBZ> 仕組み: https://ma2shita.s3.ap-northeast-1.amazonaws.com/awssummittokyo2023a/AWS+Summit+Tokyo+2023.png'
# Using:
# bash export_images.bash 7CxxxxxxxxCF "2022/10/18 7:00:00" [LOOP_COUNT:19]
# #=> 001.jpg(+2:00) ~ 019.jpg(+38:00)
# Copyright (c) 2022 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
# Released under the MIT license
# https://opensource.org/licenses/mit-license.php
DEVICE_ID=$1
START_DATETIME=$2
# Using:
# .\export_images.ps1 7CxxxxxxxxCF "2022/10/18 7:00:00" [LOOP_COUNT:19] -Verbose
# #=> 001.jpg(+2:00) ~ 019.jpg(+38:00)
# Copyright (c) 2022 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
# Released under the MIT license
# https://opensource.org/licenses/mit-license.php
[CmdletBinding()]
Param(
# Copyright (c) 2022 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
# Released under the MIT license
# https://opensource.org/licenses/mit-license.php
import sys
# Params for sin()
hz = 1.0
length_sec = 4.1
sampling_frequency = 10
# Generate
@ma2shita
ma2shita / m5stack_deviceshadow_3gextboard_soracombeam_example.ino
Last active March 18, 2022 15:45
AWS IoT Core's Device shadow implementation using SORACOM Beam on M5Stack Basic/Gray + 3G ext. board
/*
Example | AWS IoT Core's Device shadow implementation using SORACOM Beam on M5Stack Basic/Gray + 3G ext. board
Copyright (c) 2022 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
Released under the MIT license
https://opensource.org/licenses/mit-license.php
*/
#define _VERSION_ "0.9"
#define THING_NAME "mcu1"
#define SHADOW_NAME "peripheral"
/*
* Copyright (c) 2021 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#define __VERSION__ "0.999"
#define SerialMon SerialUSB
#define LOOP_INTERVAL_MS 100
@ma2shita
ma2shita / Arducam_B0176_focus_ctl.py
Created March 7, 2021 11:27
Focus control for Arducam B0176 "Motorized focus camera for Raspberry Pi"
#!/bin/env python3
"""
Focus control for Arducam B0176 "Motorized focus camera for Raspberry Pi"
See: TBC
Copyright (c) 2021 Kohei MATSUSHITA
This software is released under the The 3-Clause BSD License.
@ma2shita
ma2shita / ATECC608A_shell.py
Last active January 22, 2021 11:53
Shell for ATECC608A Trust&GO
"""
Usage:
$ cd Core2-for-AWS-IoT-EduKit/Blinky-Hello-World/
$ curl -O ATECC608A_shell.py
$ source ~/esp/esp-idf/export.sh
$ PYTHONSTARTUP=ATECC608A_shell.py python
"""
port = "/dev/ttyUSB0"
/*
* Copyright (c) 2021 Kohei "Max" MATSUSHITA (ma2shita+git@ma2shita.jp)
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#define __VERSION__ "0.999"
#define SerialMon SerialUSB
#define LOOP_INTERVAL_MS (100)
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",