This file contains 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
# -*- coding: utf-8 -*- | |
# | |
# 箱ひげ図を描画するために、最小値、第1四分位数、中央値、第3四分位数、最大値を計算し、 | |
# Ambientに書き戻す | |
# python3 quantile.py chIn readKeyIn chOut writeKeyOut field date | |
# YYYY-mm-dd 形式で指定した日のfield(d1〜d8のいずれか)に対して値を計算し、d1〜d5に書く | |
# {'d1': 最小値, 'd2': 第1四分位数, 'd3': 中央値, 'd4: 第3四分位数, 'd5': 最大値} | |
import ambient | |
import numpy as np |
This file contains 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 <Wire.h> | |
#include "porthub.h" | |
#include "Ambient.h" | |
PortHub porthub; | |
uint8_t HUB_ADDR[6]={HUB1_ADDR,HUB2_ADDR,HUB3_ADDR,HUB4_ADDR,HUB5_ADDR,HUB6_ADDR}; | |
WiFiClient client; | |
Ambient am; |
This file contains 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 <Wire.h> | |
#include "porthub.h" | |
PortHub porthub; | |
uint8_t HUB_ADDR[6]={HUB1_ADDR,HUB2_ADDR,HUB3_ADDR,HUB4_ADDR,HUB5_ADDR,HUB6_ADDR}; | |
void setup() { | |
M5.begin(); | |
porthub.begin(); |
This file contains 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 <M5Stack.h> | |
#include <Wire.h> | |
#include "Adafruit_Sensor.h" | |
#include <Adafruit_BMP280.h> | |
#include "SHT3X.h" | |
#define rxPin 16 | |
#define txPin 17 | |
SHT3X sht30; |
This file contains 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 <ModbusRTU.h> | |
#define RX_PIN 26 // RS485HatのRXピン | |
#define TX_PIN 0 // RS485HatのTXピン | |
#define REGN 10 | |
#define SLAVE_ID 1 | |
ModbusRTU mb; |
This file contains 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 <ModbusRTU.h> | |
#define RX_PIN 22 // RS485キットのRXピン | |
#define TX_PIN 19 // RS485キットのTXピン | |
#define REGN 10 | |
#define SLAVE_ID 1 | |
ModbusRTU mb; |
This file contains 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
/* | |
* TFMini-SとM5StickCで距離を測る(I2C通信版) | |
* I2C Hubで複数のTFMiniーSを制御する | |
*/ | |
#include <M5StickC.h> | |
#include <Wire.h> // Arduino standard I2C/Two-Wire Library | |
#include "ClosedCube_TCA9548A.h" | |
#include <TFMPI2C.h> // TFMini-Plus I2C Library v1.5.0 |
This file contains 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
/* | |
* TFMini-SとM5StickCで距離を測る(I2C通信版) | |
*/ | |
#include <M5StickC.h> | |
#include <Wire.h> // Arduino standard I2C/Two-Wire Library | |
#include <TFMPI2C.h> // TFMini-Plus I2C Library v1.5.0 | |
TFMPI2C tfmP; // Create a TFMini-Plus I2C object |
This file contains 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
/* | |
* TFMini-SをI2Cモードからシリアルモードにする | |
*/ | |
#include <M5StickC.h> | |
#include <Wire.h> // Arduino standard I2C/Two-Wire Library | |
#include <TFMPI2C.h> // TFMini-Plus I2C Library v1.5.0 | |
TFMPI2C tfmP; // Create a TFMini-Plus I2C object |
This file contains 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
/* | |
* TFMini-SをシリアルモードからI2Cモードにする | |
*/ | |
#include <M5StickC.h> | |
uint8_t setI2Ccmd[] = {0x5A, 0x05, 0x0A, 0x01}; | |
uint8_t saveSettingcmd[] = {0x5A, 0x04, 0x11}; | |
int sendCmd(Stream* streamPtr, uint8_t *cmd, int len, bool response) { | |
uint8_t checksum = 0; |
NewerOlder