Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- #include <ESP8266WiFi.h>
- #include <FirebaseESP8266.h>
- EspSoftwareSerial::UART testSerial;
- // WiFi credentials
- const char* ssid = "no internet";
- const char* password = "nointernet";
- void setup() {
- Serial.begin(9600);
- // Connect to Wi-Fi
- WiFi.begin(ssid, password);
- while (WiFi.status() != WL_CONNECTED) {
- delay(1000);
- Serial.print(".");
- }
- Serial.println("");
- Serial.println("WiFi connected");
- Serial.print("IP address: ");
- Serial.println(WiFi.localIP());
- testSerial.begin(115200, EspSoftwareSerial::SWSERIAL_8N1, D7, D8, false, 95, 11);
- if(!testSerial){
- Serial.println("Invalid EspSoftwareSerial pin configuration, check config");
- while(1){
- delay(1000);
- }
- }
- Serial.println("EspSoftwareSerial init");
- }
- void loop(){
- if(testSerial.available()){
- char receivedData = testSerial.read();
- Serial.println(receivedData);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment