A ma może ktoś ten kod przerobiony żeby był wyświetlacz.
Code: Select all
Copyright (C) AC SOFTWARE SP. Z O.O.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// this example will work only on esp8266 and esp32 boards. On Arduino mega it will not fly.
//dependence: Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter https://github.com/mandulaj/PZEM-004T-v30
#include <SPI.h>
#include <SuplaDevice.h>
#include <supla/io.h>
#include <supla/sensor/three_phase_PzemV3.h>
// ESP8266 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("twoja_nazwa_sieci", "twoje_haslo_do_sieci");
void setup() {
Serial.begin(9600);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //wygeneruj z linku powyżej i podmień
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey zrobiłem
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //wygeneruj z linku powyżej i podmień
//Ustaw GPIO jakie chcesz, RX jest wspólny
int rx=3;
int tx1=1;
int tx2=5;
int tx3=4;
new Supla::Sensor::ThreePhasePZEMv3(rx, tx1, rx, tx2, rx, tx3);
/*
* SuplaDevice Initialization.
* Server address, is available at https://cloud.supla.org
* If you do not have an account, you can create it at https://cloud.supla.org/account/create
* SUPLA and SUPLA CLOUD are free of charge
*
*/
//wifi.enableSSL(false); //jeśli nie będzie chciał się zarejestrować to wyłącz SSL
//podaj nr serwera i adres email
SuplaDevice.begin(GUID, // Global Unique Identifier
"svr1.supla.org", // SUPLA server address
"email@address", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}