Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
* BME280で5秒毎に温度、湿度、気圧を測定し、シリアルモニタに出力する | |
*/ | |
#include <ESP8266WiFi.h> | |
#include <SPI.h> | |
#include "BME280_SPI.h" | |
#define BME_CS 15 |
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
/* | |
* BME280で5分毎に温度、湿度、気圧を測定し、Ambientに送信する | |
*/ | |
#include <ESP8266WiFi.h> | |
#include <SPI.h> | |
#include "BME280_SPI.h" | |
#include "Ambient.h" | |
#define BME_CS 15 |
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
/* | |
* BME280で5分毎に温度、湿度、気圧を測定し、Ambientに送信する | |
* 測定と測定の間はDeep Sleepで待つ | |
* Wi−Fiの出力レベルを0.0dBmにする | |
* CPU周波数を160MHzにする | |
*/ | |
#include <ESP8266WiFi.h> | |
#include <SPI.h> | |
#include "BME280_SPI.h" | |
#include "Ambient.h" |
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
void setup() { | |
センサを初期化(); | |
センサ値を測定(); | |
Wi-Fiアクセスポイントに接続(); | |
サーバに接続し、センサ値を送信(); | |
DeepSleep(指定時間); // この後Deep Sleepし、指定時間経過後、setup()から再実行 | |
} | |
void loop() { | |
} |
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
void setup() { | |
センサを初期化(); | |
Wi-Fiアクセスポイントに接続(); | |
} | |
void loop() { | |
センサ値を測定(); | |
サーバに接続し、センサ値を送信(); | |
Delay(指定時間); | |
} |
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
void readCCS811() | |
{ | |
ccs811_wake(); // CCS811をI2C通信可能にする。 | |
CO2 = 0; | |
while (CO2 <= 400 || CO2 > 8192) { // CCS811 Datasheet よりCO2の値は400〜8192ppmとのことで、 | |
// それ以外の範囲の値を読み飛ばす | |
long t = millis(); | |
while (!ccs811.dataAvailable()) { // CCS811のデータが読み出し可能かチェックする。 | |
delay(100); |
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
void loop() | |
{ | |
int t = millis(); | |
float temp, humid, pressure; | |
// BME280で温度、湿度、気圧を測定する | |
temp = (float)bme280.readTemperature(); | |
humid = (float)bme280.readHumidity(); | |
pressure = (float)bme280.readPressure(); |
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
/* | |
* M5StackとBME280をI2C接続し、温度、湿度、気圧を測定しプリントアプトする | |
*/ | |
#include <M5Stack.h> | |
#include <Wire.h> | |
#include "BME280.h" | |
BME280 bme280; | |
void setup(){ |
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
/* | |
* M5StackとBME280をI2C接続し、温度、湿度、気圧を測定しプリントアプトする | |
*/ | |
#include <M5Stack.h> | |
#include <Wire.h> | |
#include "BME280.h" | |
#include "Ambient.h" | |
#define PERIOD 60 |
OlderNewer