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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Reflection; | |
| using System.IO; | |
| namespace HelloAIVOICE |
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 <M5StickCPlus.h> | |
| #define PCA9548AP_I2C_ADDRESS 0x70 | |
| void setup() | |
| { | |
| M5.begin(); | |
| Wire.begin(); | |
| } | |
| uint8_t selectI2CPort(uint8_t channel){ |
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 <M5GFX.h> | |
| #include <M5StickCPlus.h> | |
| #include <M5_BH1750FVI.h> | |
| M5GFX display; | |
| M5_BH1750FVI sensor; | |
| uint16_t lux; | |
| 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
| // M5Atom で BME688 のガスセンサ・ヒーターを操作するサンプル | |
| // 2022/1/6 @ksasao | |
| // | |
| // 利用デバイス: | |
| // デバイスは、下記などで入手してください | |
| // BME688搭載 4種空気質センサモジュール(ガス/温度/気圧/湿度) | |
| // https://www.switch-science.com/catalog/7383/ | |
| // | |
| // ライブラリの追加: | |
| // https://github.com/BoschSensortec/Bosch-BME68x-Library |
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 numpy as np | |
| import random | |
| import math | |
| import cv2 | |
| from PIL import Image | |
| import sys | |
| def detect_markers(im): | |
| markers = [] | |
| height, width = im.shape[:2] |
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
| // RTC時刻(秒)とシステム時刻(ミリ秒)を読み込み | |
| long rtcSec = GetRtcSec(); | |
| long systemMillsec = GetSystemMillisec(); | |
| // delta ができるだけ 0~999 に収まるようにする | |
| long delta = (systemMillsec + offset) - rtcSec * 1000; | |
| // 100ms 以上のずれがある場合は offset を再計算 | |
| int d = 100; | |
| if(delta > 1000 + d || delta < -d) |
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
| using MetadataExtractor; | |
| using MetadataExtractor.Formats.Exif; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Numerics; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks; |
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
| /// <summary> | |
| /// 非凸多角形に対して、a番目, b番目(a<b)の頂点を結んだときに他の辺と交差するかどうかを判定する | |
| /// </summary> | |
| /// <param name="pts">多角形の点列。点の並びが反時計回りになっていることを期待している。</param> | |
| /// <param name="a">a番目の点</param> | |
| /// <param name="b">b番目の点</param> | |
| /// <returns>交差すれば true</returns> | |
| private bool Crossed(PointF[] pts, int a, int b) | |
| { | |
| float abX = pts[b].X - pts[a].X; |
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
| // Sensirion SCD40を M5Atom で動かすためのサンプルコード | |
| // 2021/7/20 @ksasao | |
| // * 公式のサンプルコードを一部改変 | |
| // Arduino の [ツール]>[ライブラリを管理]で、SDC40で検索し、 | |
| // Sensirion I2C SCD4x を追加してビルドしてください | |
| // https://twitter.com/ksasao/status/1417455450929262598 | |
| /* | |
| * Copyright (c) 2021, Sensirion AG | |
| * All rights reserved. | |
| * |
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> | |
| float accX = 0; | |
| float accY = 0; | |
| float accZ = 0; | |
| void setup() { | |
| M5.begin(); | |
| M5.IMU.Init(); | |
| M5.Lcd.setRotation(3); |