-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from yakumo-saki/v3.2
V3.2
- Loading branch information
Showing
39 changed files
with
421 additions
and
211 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void i2c_scan(); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
void init_sensors(); | ||
void setup_normal(); | ||
void loop_normal(); | ||
void loop_normal(); | ||
void read_data(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void setup_normal_mqtt(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <Arduino.h> | ||
|
||
// mdns.h ではないのは、 dunk mdnsのヘッダファイルが mdns.h なため | ||
|
||
void mdns_setup(); | ||
void mdns_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
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
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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#ifdef ESP32 | ||
#define ST7789_SUPPORTED | ||
#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
File renamed without changes.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef ST7789_SUPPORTED | ||
|
||
// ST7789 非サポートのボード用。呼ばれることはない。コンパイルを通すためだけのもの | ||
|
||
#include <Arduino.h> | ||
#include "global.h" | ||
#include "structs.h" | ||
|
||
void disp_st7789_wifi_info(String ip, String mDNS) {} | ||
void disp_st7789_normal_startup_screen(String product_long) {} | ||
void disp_st7789_wait_for_reconfig_init() {} | ||
void disp_st7789_wait_for_reconfig_bar(int now, const int max) {} | ||
void disp_st7789_wifi_starting(int wait_print_row) {} | ||
void disp_st7789_all_initialize_complete(String ip, String mdns) {}; | ||
void disp_st7789_sensor_value(disp_values_t new_values, disp_values_t last_values) {}; | ||
void disp_st7789_power_off() {}; | ||
|
||
void disp_st7789_wifi_error() {}; | ||
|
||
String disp_st7789_set_brightness(int brightness) { return ""; } | ||
|
||
/** | ||
* 液晶のON/OFFを設定する | ||
* @param poweron true = ONにする false = offにする | ||
*/ | ||
void disp_st7789_set_power(bool poweron) {}; | ||
|
||
void setup_disp_st7789() {}; | ||
|
||
#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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
#include <Arduino.h> | ||
#include <Wire.h> | ||
|
||
#include "log.h" | ||
#include "i2c_scan.h" | ||
|
||
bool init_i2c(int sda, int scl) { | ||
bool ret = true; | ||
#ifdef ESP32 | ||
return Wire.begin(sda, scl); | ||
i2clog("Initializing ESP32 I2C SDA=" + String(sda) + " SCL=" + String(scl)); | ||
ret = Wire.begin(sda, scl); | ||
if (ret) { | ||
i2clog("I2C initialized."); | ||
} else { | ||
i2clog("error initializing I2C"); | ||
} | ||
#endif | ||
#ifdef ESP8266 | ||
Wire.begin(sda, scl); | ||
return true; | ||
i2clog("Initializing ESP8266 I2C SDA=" + String(sda) + " SCL=" + String(scl)); | ||
Wire.begin(sda, scl); // 8266のbeginは返り値がない | ||
i2clog("I2C initialized."); | ||
#endif | ||
|
||
i2c_scan(); | ||
|
||
return ret; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include <Arduino.h> | ||
#include <Wire.h> | ||
|
||
#include "log.h" | ||
|
||
void i2c_scan() | ||
{ | ||
|
||
unsigned long start = millis(); | ||
|
||
byte error, address; | ||
int nDevices = 0; | ||
for(address = 1; address < 127; address++ ) | ||
{ | ||
|
||
Wire.beginTransmission(address); | ||
error = Wire.endTransmission(); | ||
|
||
if (error == 0) | ||
{ | ||
String msg = "I2C device found at address 0x"; | ||
if (address<16) | ||
msg += "0"; | ||
msg += String(address,HEX); | ||
msg += " " + String(address); | ||
i2clog(msg); | ||
nDevices++; | ||
} | ||
else if (error==4) | ||
{ | ||
String msg = "Unknown error at address 0x"; | ||
if (address<16) | ||
msg += "0"; | ||
msg += String(address,HEX); | ||
i2clog(msg); | ||
} | ||
} | ||
|
||
if (nDevices == 0) { | ||
i2clog("No I2C devices found"); | ||
} | ||
|
||
i2clog("i2c scan done. time = " + String(millis() - start) + " ms"); | ||
|
||
} |
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
Oops, something went wrong.