Skip to content

Instantly share code, notes, and snippets.

Avatar

Kohei MATSUSHITA ma2shita

View GitHub Profile
@ma2shita
ma2shita / m5stack_deviceshadow_3gextboard_soracombeam_example.ino
Last active Mar 18, 2022
AWS IoT Core's Device shadow implementation using SORACOM Beam on M5Stack Basic/Gray + 3G ext. board
View m5stack_deviceshadow_3gextboard_soracombeam_example.ino
/*
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"
View keigan_motor_control_by_mqtt_sub.ino
/*
* 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 Mar 7, 2021
Focus control for Arducam B0176 "Motorized focus camera for Raspberry Pi"
View Arducam_B0176_focus_ctl.py
#!/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 Jan 22, 2021
Shell for ATECC608A Trust&GO
View ATECC608A_shell.py
"""
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"
View WioLTE_KeiganMotor_MQTT_ctrl.ino
/*
* 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)
View lagoon_template_for_ambient_monitor_using_arduino.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View lagoon_template_for_m5stack_tof_ranger2.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@ma2shita
ma2shita / m5stack_tof_ranger2.ino
Last active Dec 6, 2020
ToF ranger with 3G ext. board and SORACOM UnifiedEndpoint for M5Stack / See: https://soracom.github.io/iot-recipes/poka-yoke-for-coffee-dispenser-by-m5stack/
View m5stack_tof_ranger2.ino
/*
* Copyright (c) 2020 SORACOM, INC.
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <M5Stack.h>
#include <HTTPClient.h> // Why? see https://qiita.com/ma2shita/items/97bf1a0c3158b848019a
#define SerialMon Serial
#define TEXT_SIZE 2
@ma2shita
ma2shita / sensor_test.py
Last active Aug 31, 2020
Ultrasonic Range sensor (US-100) test code (Let's try IoT Prototyping / MFT2020)
View sensor_test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
# 距離を読む関数
def read_distance():
# 必要なライブラリのインポート・設定
import RPi.GPIO as GPIO
# 使用するピンの設定
View m5stack_take_a_thing_notifier_edge.ino
/*
* "Take a thing" notifier with 3G (All-in the edge)
*
* Copyright (c) 2020 Kohei MATSUSHITA
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
#include <M5Stack.h>
#define console Serial