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 "WiFi.h" | |
#include "ESPAsyncWebServer.h" | |
const char* ssid = "Xuong May Gia Si";//"yourNetworkName"; | |
const char* password = "123456789";// "yourNetworkPassword"; | |
AsyncWebServer server(80); | |
AsyncWebSocket ws("/ws"); | |
void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){ |
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 <WiFi.h> | |
#include <MQTT.h> | |
const char ssid[] = "ssid"; | |
const char password[] = "pass"; | |
WiFiClient net; | |
MQTTClient client; |
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 <BLEDevice.h> | |
#include <BLEServer.h> | |
#include <BLEUtils.h> | |
#include <BLE2902.h> | |
BLEServer* pServer = NULL; | |
BLECharacteristic* pCharacteristic = NULL; | |
bool deviceConnected = false; | |
bool oldDeviceConnected = false; |
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
String prepairData() { | |
int temperatureAdc = analogRead(SENSOR); | |
byte adcH = (temperatureAdc & 0xFF00) >> 8; | |
byte adcL = (temperatureAdc & 0x00FF); | |
byte inputstate = digitalRead(INP); | |
DebugSerial.print("<Adc:"); | |
DebugSerial.print(temperatureAdc); | |
DebugSerial.print(">"); | |
DebugSerial.print("<input:"); |
OlderNewer