Last active
January 30, 2023 05:39
-
-
Save katsuyoshi/8cfe58c5cfe463f33643b0abd85cd23d to your computer and use it in GitHub Desktop.
M5Stamp picoで1.9inch Segment e-Paper Moduleのサンプルプログラムを試して見る。からの温湿度計に
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
#ifndef __ENV_H__ | |
#define __ENV_H__ | |
#define WIFI_SSID "your wifi ssid" | |
#define WIFI_PASSWORD "your password for WIFI_SSID" | |
//#define WIFI_SSID_2 "your second wifi ssid if you have" | |
//#define WIFI_PASSWORD_2 "your password for WIFI_SSID2" | |
//#define WIFI_SSID_3 "your third wifi ssid if you have" | |
//#define WIFI_PASSWORD_3 "your password for WIFI_SSID3" | |
#define AMBIENT_CHANNEL_ID 1234 // your ambient channel id | |
#define AMBIENT_WRITE_KEY "your write key of ambient" | |
#endif |
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 <Wire.h> | |
#include <stdlib.h> | |
#include "EPD_1in9.h" | |
//////////////////////////////////////full screen update LUT//////////////////////////////////////////// | |
unsigned char DSPNUM_1in9_on[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; // all black | |
unsigned char DSPNUM_1in9_off[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; // all white | |
unsigned char DSPNUM_1in9_WB[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; // All black font | |
unsigned char DSPNUM_1in9_W0[] = {0x00, 0xbf, 0x1f, 0xbf, 0x1f, 0xbf, 0x1f, 0xbf, 0x1f, 0xbf, 0x1f, 0xbf, 0x1f, 0x00, 0x00, }; // 0 | |
unsigned char DSPNUM_1in9_W1[] = {0xff, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00, 0x00, }; // 1 | |
unsigned char DSPNUM_1in9_W2[] = {0x00, 0xfd, 0x17, 0xfd, 0x17, 0xfd, 0x17, 0xfd, 0x17, 0xfd, 0x17, 0xfd, 0x37, 0x00, 0x00, }; // 2 | |
unsigned char DSPNUM_1in9_W3[] = {0x00, 0xf5, 0x1f, 0xf5, 0x1f, 0xf5, 0x1f, 0xf5, 0x1f, 0xf5, 0x1f, 0xf5, 0x1f, 0x00, 0x00, }; // 3 | |
unsigned char DSPNUM_1in9_W4[] = {0x00, 0x47, 0x1f, 0x47, 0x1f, 0x47, 0x1f, 0x47, 0x1f, 0x47, 0x1f, 0x47, 0x3f, 0x00, 0x00, }; // 4 | |
unsigned char DSPNUM_1in9_W5[] = {0x00, 0xf7, 0x1d, 0xf7, 0x1d, 0xf7, 0x1d, 0xf7, 0x1d, 0xf7, 0x1d, 0xf7, 0x1d, 0x00, 0x00, }; // 5 | |
unsigned char DSPNUM_1in9_W6[] = {0x00, 0xff, 0x1d, 0xff, 0x1d, 0xff, 0x1d, 0xff, 0x1d, 0xff, 0x1d, 0xff, 0x3d, 0x00, 0x00, }; // 6 | |
unsigned char DSPNUM_1in9_W7[] = {0x00, 0x21, 0x1f, 0x21, 0x1f, 0x21, 0x1f, 0x21, 0x1f, 0x21, 0x1f, 0x21, 0x1f, 0x00, 0x00, }; // 7 | |
unsigned char DSPNUM_1in9_W8[] = {0x00, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x3f, 0x00, 0x00, }; // 8 | |
unsigned char DSPNUM_1in9_W9[] = {0x00, 0xf7, 0x1f, 0xf7, 0x1f, 0xf7, 0x1f, 0xf7, 0x1f, 0xf7, 0x1f, 0xf7, 0x1f, 0x00, 0x00, }; // 9 | |
//unsigned char VAR_Temperature=20; | |
/****************************************************************************** | |
function : GPIO Init | |
parameter: | |
******************************************************************************/ | |
void GPIOInit(void) | |
{ | |
pinMode(EPD_BUSY_PIN, INPUT); | |
pinMode(EPD_RST_PIN, OUTPUT); | |
} | |
/****************************************************************************** | |
function : Software reset | |
parameter: | |
******************************************************************************/ | |
void EPD_1in9_Reset(void) | |
{ | |
digitalWrite(EPD_RST_PIN, 1); | |
delay(200); | |
digitalWrite(EPD_RST_PIN, 0); | |
delay(20); | |
digitalWrite(EPD_RST_PIN, 1); | |
delay(200); | |
} | |
/****************************************************************************** | |
function : send command | |
parameter: | |
Reg : Command register | |
******************************************************************************/ | |
void EPD_1in9_SendCommand(unsigned char Reg) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(Reg); | |
Wire.endTransmission(false); | |
} | |
/****************************************************************************** | |
function : send data | |
parameter: | |
Data : Write data | |
******************************************************************************/ | |
void EPD_1in9_SendData(unsigned char Data) | |
{ | |
Wire.beginTransmission(adds_data); | |
Wire.write(Data); | |
Wire.endTransmission(); | |
} | |
/****************************************************************************** | |
function : read command | |
parameter: | |
Reg : Command register | |
******************************************************************************/ | |
unsigned char EPD_1in9_readCommand(unsigned char Reg) | |
{ | |
unsigned char a; | |
Wire.beginTransmission(adds_com); | |
delay(10); | |
Wire.write(Reg); | |
a = Wire.read(); | |
Wire.endTransmission(); | |
return a; | |
} | |
/****************************************************************************** | |
function : read data | |
parameter: | |
Data : Write data | |
******************************************************************************/ | |
unsigned char EPD_1in9_readData(unsigned char Data) | |
{ | |
unsigned char a; | |
Wire.beginTransmission(adds_data); | |
delay(10); | |
Wire.write(Data); | |
a = Wire.read(); | |
Wire.endTransmission(); | |
return a; | |
} | |
/****************************************************************************** | |
function : Wait until the busy_pin goes LOW | |
parameter: | |
******************************************************************************/ | |
void EPD_1in9_ReadBusy(void) | |
{ | |
Serial.println("e-Paper busy"); | |
delay(10); | |
while(1) | |
{ //=1 BUSY; | |
if(digitalRead(EPD_BUSY_PIN)==1) | |
break; | |
delay(1); | |
} | |
delay(10); | |
Serial.println("e-Paper busy release"); | |
} | |
/* | |
# DU waveform white extinction diagram + black out diagram | |
# Bureau of brush waveform | |
*/ | |
void EPD_1in9_lut_DU_WB(void) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0x82); | |
Wire.write(0x80); | |
Wire.write(0x00); | |
Wire.write(0xC0); | |
Wire.write(0x80); | |
Wire.write(0x80); | |
Wire.write(0x62); | |
Wire.endTransmission(); | |
} | |
/* | |
# GC waveform | |
# The brush waveform | |
*/ | |
void EPD_1in9_lut_GC(void) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0x82); | |
Wire.write(0x20); | |
Wire.write(0x00); | |
Wire.write(0xA0); | |
Wire.write(0x80); | |
Wire.write(0x40); | |
Wire.write(0x63); | |
Wire.endTransmission(); | |
} | |
/* | |
# 5 waveform better ghosting | |
# Boot waveform | |
*/ | |
void EPD_1in9_lut_5S(void) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0x82); | |
Wire.write(0x28); | |
Wire.write(0x20); | |
Wire.write(0xA8); | |
Wire.write(0xA0); | |
Wire.write(0x50); | |
Wire.write(0x65); | |
Wire.endTransmission(); | |
} | |
/* | |
# temperature measurement | |
# You are advised to periodically measure the temperature and modify the driver parameters | |
# If an external temperature sensor is available, use an external temperature sensor | |
*/ | |
void EPD_1in9_Temperature(int temperature) | |
{ | |
Wire.beginTransmission(adds_com); | |
if( temperature < 10 ) | |
{ | |
Wire.write(0x7E); | |
Wire.write(0x81); | |
Wire.write(0xB4); | |
} | |
else | |
{ | |
Wire.write(0x7E); | |
Wire.write(0x81); | |
Wire.write(0xB4); | |
} | |
Wire.endTransmission(); | |
delay(10); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xe7); // Set default frame time | |
// Set default frame time | |
if(temperature<5) | |
Wire.write(0x31); // 0x31 (49+1)*20ms=1000ms | |
else if(temperature<10) | |
Wire.write(0x22); // 0x22 (34+1)*20ms=700ms | |
else if(temperature<15) | |
Wire.write(0x18); // 0x18 (24+1)*20ms=500ms | |
else if(temperature<20) | |
Wire.write(0x13); // 0x13 (19+1)*20ms=400ms | |
else | |
Wire.write(0x0e); // 0x0e (14+1)*20ms=300ms | |
Wire.endTransmission(); | |
} | |
/* | |
# Note that the size and frame rate of V0 need to be set during initialization, | |
# otherwise the local brush will not be displayed | |
*/ | |
void EPD_1in9_init(void) | |
{ | |
unsigned char i = 0; | |
EPD_1in9_Reset(); | |
delay(100); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0x2B); // POWER_ON | |
Wire.endTransmission(); | |
delay(10); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xA7); // boost | |
Wire.write(0xE0); // TSON | |
Wire.endTransmission(); | |
delay(10); | |
EPD_1in9_Temperature(); | |
} | |
void EPD_1in9_Write_Screen( unsigned char *image) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAC); // Close the sleep | |
Wire.write(0x2B); // turn on the power | |
Wire.write(0x40); // Write RAM address | |
Wire.write(0xA9); // Turn on the first SRAM | |
Wire.write(0xA8); // Shut down the first SRAM | |
Wire.endTransmission(); | |
Wire.beginTransmission(adds_data); | |
for(char j = 0 ; j<15 ; j++ ) | |
Wire.write(image[j]); | |
Wire.write(0x00); | |
Wire.endTransmission(); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAB); // Turn on the second SRAM | |
Wire.write(0xAA); // Shut down the second SRAM | |
Wire.write(0xAF); // display on | |
Wire.endTransmission(); | |
EPD_1in9_ReadBusy(); | |
//delay(2000); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAE); // display off | |
Wire.write(0x28); // HV OFF | |
Wire.write(0xAD); // sleep in | |
Wire.endTransmission(); | |
} | |
void EPD_1in9_Write_Screen1( unsigned char *image) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAC); // Close the sleep | |
Wire.write(0x2B); // turn on the power | |
Wire.write(0x40); // Write RAM address | |
Wire.write(0xA9); // Turn on the first SRAM | |
Wire.write(0xA8); // Shut down the first SRAM | |
Wire.endTransmission(); | |
Wire.beginTransmission(adds_data); | |
for(char j = 0 ; j<15 ; j++ ) | |
Wire.write(image[j]); | |
Wire.write(0x03); | |
Wire.endTransmission(); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAB); // Turn on the second SRAM | |
Wire.write(0xAA); // Shut down the second SRAM | |
Wire.write(0xAF); // display on | |
Wire.endTransmission(); | |
EPD_1in9_ReadBusy(); | |
//delay(2000); | |
Wire.beginTransmission(adds_com); | |
Wire.write(0xAE); // display off | |
Wire.write(0x28); // HV OFF | |
Wire.write(0xAD); // sleep in | |
Wire.endTransmission(); | |
} | |
void EPD_1in9_sleep(void) | |
{ | |
Wire.beginTransmission(adds_com); | |
Wire.write(0x28); // POWER_OFF | |
EPD_1in9_ReadBusy(); | |
Wire.write(0xAC); // DEEP_SLEEP | |
Wire.endTransmission(); | |
delay(2000); | |
// digitalWrite(EPD_RST_PIN, 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
#ifndef _EPD_1in9_H_ | |
#define _EPD_1in9_H_ | |
#include <Arduino.h> | |
#include <Wire.h> | |
#include <stdlib.h> | |
// address | |
#define adds_com 0x3C | |
#define adds_data 0x3D | |
#define EPD_BUSY_PIN 19 | |
#define EPD_RST_PIN 18 | |
extern unsigned char DSPNUM_1in9_on[]; | |
extern unsigned char DSPNUM_1in9_off[]; | |
extern unsigned char DSPNUM_1in9_WB[]; | |
extern unsigned char DSPNUM_1in9_W0[]; | |
extern unsigned char DSPNUM_1in9_W1[]; | |
extern unsigned char DSPNUM_1in9_W2[]; | |
extern unsigned char DSPNUM_1in9_W3[]; | |
extern unsigned char DSPNUM_1in9_W4[]; | |
extern unsigned char DSPNUM_1in9_W5[]; | |
extern unsigned char DSPNUM_1in9_W6[]; | |
extern unsigned char DSPNUM_1in9_W7[]; | |
extern unsigned char DSPNUM_1in9_W8[]; | |
extern unsigned char DSPNUM_1in9_W9[]; | |
void GPIOInit(void); | |
void EPD_1in9_Reset(void); | |
void EPD_1in9_SendCommand(unsigned char Reg); | |
void EPD_1in9_SendData(unsigned char Data); | |
unsigned char EPD_1in9_readCommand(unsigned char Reg); | |
unsigned char EPD_1in9_readData(unsigned char Data); | |
void EPD_1in9_ReadBusy(void); | |
void EPD_1in9_lut_DU_WB(void); | |
void EPD_1in9_lut_GC(void); | |
void EPD_1in9_lut_5S(void); | |
void EPD_1in9_Temperature(int temperature=20); | |
void EPD_1in9_init(void); | |
void EPD_1in9_Write_Screen(unsigned char *image); | |
void EPD_1in9_Write_Screen1(unsigned char *image); | |
void EPD_1in9_sleep(void); | |
#endif |
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 <Arduino.h> | |
#include "EPD_1in9.h" | |
#include <M5Unified.h> | |
#include <Adafruit_Sensor.h> | |
#include <DHT.h> | |
#include <DHT_U.h> | |
#include <WiFiMulti.h> | |
#include <Ambient.h> | |
#include "env.h" | |
#define I2C_SDA_PIN 21 | |
#define I2C_SCL_PIN 22 | |
#define DHTPIN 26 // Digital pin connected to the DHT sensor | |
#define DHTTYPE DHT11 // DHT 11 | |
//#define TEST | |
#ifndef TEST | |
#define INTERVAL_MS (5 * 60 * 1000) | |
#define REFRESH_INTERVAL (24 * 60 * 60 * 1000) | |
#else | |
#define INTERVAL_MS (30 * 1000) | |
#define REFRESH_INTERVAL (30 * 1000) | |
#endif | |
#define REFRESH_PERIOD (REFRESH_INTERVAL / INTERVAL_MS) | |
static DHT_Unified dht(DHTPIN, DHTTYPE); | |
static uint32_t delayMS; | |
static float temperature = 0.0; | |
static float humidity = 0.0; | |
static unsigned long wake_at; | |
static unsigned int wake_count = 0; | |
static bool needs_refresh = false; | |
static WiFiMulti wifiMulti; | |
static WiFiClient client; | |
static Ambient ambient; | |
void setup_epd_1in9() | |
{ | |
GPIOInit(); | |
EPD_1in9_init(); | |
/* | |
EPD_1in9_lut_5S(); | |
EPD_1in9_Write_Screen(DSPNUM_1in9_off); | |
delay(500); | |
EPD_1in9_lut_GC(); | |
EPD_1in9_Write_Screen1(DSPNUM_1in9_on); | |
delay(500); | |
EPD_1in9_Write_Screen(DSPNUM_1in9_off); | |
delay(500); | |
EPD_1in9_lut_DU_WB(); | |
*/ | |
} | |
void setup_dht11() { | |
dht.begin(); | |
sensor_t sensor; | |
dht.temperature().getSensor(&sensor); | |
dht.humidity().getSensor(&sensor); | |
delayMS = sensor.min_delay / 1000; | |
} | |
void display_refresh() | |
{ | |
EPD_1in9_Write_Screen(DSPNUM_1in9_off); | |
delay(500); | |
EPD_1in9_Write_Screen(DSPNUM_1in9_on); | |
delay(500); | |
EPD_1in9_Write_Screen(DSPNUM_1in9_off); | |
delay(500); | |
} | |
void display_digit(unsigned char buff[], int digit, char num) { | |
static unsigned short segmet_pattern[10] = { | |
0x1fbf, // 0 | |
0x1f00, // 1 | |
0x17fd, // 2 | |
0x1ff5, // 3 | |
0x1f47, // 4 | |
0x1df7, // 5 | |
0x1dff, // 6 | |
0x1f21, // 7 | |
0x1fff, // 8 | |
0x1ff7 // 9 | |
}; | |
if (digit == 0) { | |
switch (num) { | |
case '1': | |
buff[0] = segmet_pattern[num - '0'] >> 8; | |
break; | |
default: | |
buff[0] = 0x00; | |
break; | |
} | |
} else { | |
unsigned int loc = digit * 2 - 1; | |
switch (num) { | |
case '0': | |
case '1': | |
case '2': | |
case '3': | |
case '4': | |
case '5': | |
case '6': | |
case '7': | |
case '8': | |
case '9': | |
buff[loc] = segmet_pattern[num - '0'] & 0xff; | |
buff[loc + 1] = segmet_pattern[num - '0'] >> 8; | |
break; | |
default: | |
buff[loc] = 0x00; | |
buff[loc + 1] = 0x00; | |
} | |
} | |
} | |
#define EPD_BUFF_SIZE 15 | |
void display() { | |
static unsigned char ex_buff[EPD_BUFF_SIZE] = {0}; | |
static unsigned char buff[EPD_BUFF_SIZE] = {0}; | |
char str[16] = {0}; | |
if (needs_refresh) { | |
display_refresh(); | |
} | |
sprintf(str, "%5.1f%5.1f", temperature, humidity); | |
display_digit(buff, 0, str[0]); | |
display_digit(buff, 1, str[1]); | |
display_digit(buff, 2, str[2]); | |
display_digit(buff, 6, str[4]); | |
display_digit(buff, 3, str[6]); | |
display_digit(buff, 4, str[7]); | |
display_digit(buff, 5, str[9]); | |
/* dot & % */ | |
buff[2 * 2] |= 0x20; | |
buff[4 * 2] |= 0x20; | |
buff[5 * 2] |= 0x20; | |
/* c or f */ | |
buff[13] = 0x5; // Celsius | |
// buff[13] = 0x6; // Fahrenheit | |
/* bluetooth */ | |
// buff[13] |= 0x08; | |
/* battery */ | |
int b_lev = M5.Power.getBatteryLevel(); | |
if (0 < b_lev && b_lev < 50) { | |
buff[13] |= 0x10; | |
} | |
if (needs_refresh || memcmp(ex_buff, buff, EPD_BUFF_SIZE) != 0) { | |
Serial.println("update"); | |
EPD_1in9_Temperature((int)(temperature + 0.5)); | |
EPD_1in9_Write_Screen(buff); | |
delay(500); | |
memcpy(ex_buff, buff, EPD_BUFF_SIZE); | |
} | |
} | |
void awake() { | |
Serial.println("awake"); | |
wake_at = millis(); | |
if (wake_count >= REFRESH_PERIOD) { | |
wake_count = 0; | |
needs_refresh = true; | |
} else { | |
needs_refresh = false; | |
} | |
} | |
void sleep() { | |
Serial.println("sleep"); | |
//delay(100); | |
EPD_1in9_sleep(); | |
unsigned long now = millis(); | |
unsigned long past_mills = now - wake_at; | |
uint64_t sleep_us = (uint64_t)(INTERVAL_MS - past_mills) * (uint64_t)1000; | |
#if 1 | |
// 消費電流: 0.65mA | |
esp_deep_sleep(sleep_us); | |
// Cold startがかかるので以下は実行されない。 | |
#else | |
// 消費電流: 3.64mA | |
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF); | |
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF); | |
esp_sleep_pd_config(ESP_PD_DOMAIN_MAX, ESP_PD_OPTION_OFF); | |
esp_sleep_enable_timer_wakeup(sleep_us); | |
esp_light_sleep_start(); | |
wake_count++; | |
awake(); | |
#endif | |
} | |
void init_wifi() { | |
WiFi.disconnect(); | |
WiFi.softAPdisconnect(true); | |
WiFi.mode(WIFI_STA); | |
wifiMulti.addAP(WIFI_SSID, WIFI_PASSWORD); | |
#ifdef WIFI_SSID2 | |
wifiMulti.addAP(WIFI_SSID2, WIFI_PASSWORD2); | |
#endif | |
#ifdef WIFI_SSID3 | |
wifiMulti.addAP(WIFI_SSID3, WIFI_PASSWORD3); | |
#endif | |
ambient.begin(AMBIENT_CHANNEL_ID, AMBIENT_WRITE_KEY, &client); | |
} | |
void send_data_to_ambient() { | |
unsigned long start_at = millis(); | |
unsigned long now = start_at; | |
while(now - start_at < 10000) { | |
if (wifiMulti.run() == WL_CONNECTED) { | |
ambient.set(2, temperature); | |
ambient.set(3, humidity); | |
ambient.send(); | |
return; | |
} | |
delay(100); | |
now = millis(); | |
} | |
Serial.println("Sending data to ambient is fail."); | |
} | |
void setup() { | |
auto cfg = M5.config(); | |
M5.begin(cfg); | |
M5.Power.begin(); | |
Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); | |
setup_epd_1in9(); | |
setup_dht11(); | |
init_wifi(); | |
awake(); | |
} | |
void loop() { | |
// Delay between measurements. | |
delay(delayMS); | |
// Get temperature event and print its value. | |
sensors_event_t event; | |
dht.temperature().getEvent(&event); | |
if (isnan(event.temperature)) { | |
Serial.println(F("Error reading temperature!")); | |
} | |
else { | |
Serial.print(F("Temperature: ")); | |
Serial.print(event.temperature); | |
Serial.println(F("°C")); | |
temperature = max(event.temperature, 0.0f); | |
} | |
// Get humidity event and print its value. | |
dht.humidity().getEvent(&event); | |
if (isnan(event.relative_humidity)) { | |
Serial.println(F("Error reading humidity!")); | |
} | |
else { | |
humidity = event.relative_humidity; | |
Serial.print(F("Humidity: ")); | |
Serial.print(event.relative_humidity); | |
Serial.println(F("%")); | |
display(); | |
send_data_to_ambient(); | |
sleep(); | |
} | |
} |
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
; PlatformIO Project Configuration File | |
; | |
; Build options: build flags, source filter | |
; Upload options: custom upload port, speed and extra flags | |
; Library options: dependencies, extra library storages | |
; Advanced options: extra scripting | |
; | |
; Please visit documentation for the other options and examples | |
; https://docs.platformio.org/page/projectconf.html | |
[env:m5stack-atom] | |
platform = espressif32 | |
board = m5stack-atom | |
framework = arduino | |
lib_deps = | |
m5stack/M5Unified@^0.1.1 | |
adafruit/DHT sensor library@^1.4.4 | |
ambientdatainc/Ambient ESP32 ESP8266 lib@^1.0.3 | |
monitor_speed = 115200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment