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 <Arduino.h> | |
| #include <DHT11.h> | |
| #include <Wire.h> | |
| #include <BME280I2C.h> | |
| // #include <ESP8266WiFi.h> | |
| // #include <MQTT.h> | |
| #define MOTOR_INA_PIN D5 | |
| #define MOTOR_INB_PIN D6 | |
| #define DHT_SENSOR_PIN D7 |
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
| void serialEvent() { | |
| while (Serial.available()) { | |
| // get the new byte: | |
| char inChar = (char)Serial.read(); | |
| // add it to the inputString: | |
| inputString += inChar; | |
| // if the incoming character is a newline, set a flag so the main loop can | |
| // do something about it: | |
| if (inChar == '\n') { | |
| stringComplete = true; |
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 "Arduino.h" | |
| #include "SoftwareSerial.h" | |
| #define INIT_BPS (9600) | |
| #define WORK_BPS (38400) | |
| #ifdef ARDUINO_AVR_UNO | |
| #define HC12RX (7) | |
| #define HC12TX (6) | |
| #define HC12SET (5) |
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 "Wire.h" | |
| extern "C" { | |
| #include "utility/twi.h" | |
| } | |
| void scanI2CBus(byte from_addr, byte to_addr, void(*callback)(byte address, byte result) ) | |
| { | |
| byte rc; | |
| byte data = 0; |
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
| #ifndef __SERIALLOG_H__ | |
| #define __SERIALLOG_H__ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #ifdef __cplusplus | |
| extern "C" | |
| { | |
| #endif |
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
| .PHONY: lint compile upload clean | |
| lint: | |
| cpplint --extensions=ino --filter=-legal/copyright,-readability/todo *.ino | |
| compile: | |
| arduino-cli compile --fqbn esp8266com:esp8266:d1_mini ./ | |
| upload: compile | |
| arduino-cli upload -p /dev/cu.wchusbserial1410 --fqbn esp8266com:esp8266:d1_mini ./ |
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
| #if defined USE_SPIFFS | |
| #include <FS.h> | |
| const char* fsName = "SPIFFS"; | |
| FS* fileSystem = &SPIFFS; | |
| SPIFFSConfig fileSystemConfig = SPIFFSConfig(); | |
| #elif defined USE_LITTLEFS | |
| #include <LittleFS.h> | |
| const char* fsName = "LittleFS"; | |
| FS* fileSystem = &LittleFS; | |
| LittleFSConfig fileSystemConfig = LittleFSConfig(); |
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
| typedef struct { | |
| union { | |
| struct { | |
| gpio_num_t D0, D1, D2, D3, D4, D5, D6, D7; | |
| gpio_num_t RS, EN; | |
| } gpio; | |
| struct { | |
| i2c_port_t port; | |
| uint8_t address; |
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
| #pragma once | |
| const char LCD_ALPHA = 0xE0; | |
| const char LCD_BETA = 0xE2; | |
| const char LCD_EPSILON = 0xE3; | |
| const char LCD_MU = 0xE4; | |
| const char LCD_RHO = 0xE5; | |
| const char LCD_SQROOT = 0xE7; | |
| const char LCD_THETA = 0xF2; |
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
| #pragma once | |
| #include <Arduino.h> | |
| #ifdef ESP8266 | |
| #define RTCU_ERROR 0 | |
| #define RTCU_READ 1 | |
| #define RTCU_RESET 2 | |
| template <typename T> |
NewerOlder