Arduino
Witam Wszystkich zaczynam przygodę z Arduino Mega i suplą udało mi się powielić przekazniki w programie czyli zrobiłem sobie 4 przekazniki i potrzebuje do nich sterowanie ręczne czyli przyciski siedze nad tym już kilka godzin i nic przydały by się tę kontaktrony bo dwa przekazniki idą do bram a pozostałe dwa do lamp może gotowy wsad do Arduino od Was z góry dziękuje za pomoc napewno w przyszłości gotowy wsad pomógł by mi rozpisywać kod bo wiedziałbym w którym miejscu dopisywać odpowiednie linijki
Witam Wszystkich
Tu kolega ma to : https://gui-generic-builder.supla.io/mieta1987 pisze: ↑czw gru 02, 2021 8:42 pm Witam Wszystkich zaczynam przygodę z Arduino Mega i suplą udało mi się powielić przekazniki w programie czyli zrobiłem sobie 4 przekazniki i potrzebuje do nich sterowanie ręczne czyli przyciski siedze nad tym już kilka godzin i nic przydały by się tę kontaktrony bo dwa przekazniki idą do bram a pozostałe dwa do lamp może gotowy wsad do Arduino od Was z góry dziękuje za pomoc napewno w przyszłości gotowy wsad pomógł by mi rozpisywać kod bo wiedziałbym w którym miejscu dopisywać odpowiednie linijki
jak coś nie działa to włącz zasilanie.....
/*
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.
*/
#include <SuplaDevice.h>
#include <supla/control/relay.h>
#include <supla/control/button.h>
// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);
// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif
void setup() {
Serial.begin(115200);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {0x38,0x05,0xB8,0xDD,0x15,0xCA,0xB8,0x72,0x1E,0x40,0xBC,0xF1,0x21,0x81,0x45,0x67};
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x89,0x1C,0xC3,0x15,0xA9,0x0D,0xCD,0xBD,0xC5,0xAA,0x9E,0x28,0xA6,0x93,0x84,0x7B};
/*
* Having your device already registered at cloud.supla.org,
* you want to change CHANNEL sequence or remove any of them,
* then you must also remove the device itself from cloud.supla.org.
* Otherwise you will get "Channel conflict!" error.
*/
auto secretRelay = new Supla::Control::Relay(22, true);
new Supla::Control::Relay(23, true);
new Supla::Control::Relay(24, true);
new Supla::Control::Relay(25, true);
/*
* 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
*
*/
SuplaDevice.begin(GUID, // Global Unique Identifier
"", // SUPLA server address
"", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}
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.
*/
#include <SuplaDevice.h>
#include <supla/control/relay.h>
#include <supla/control/button.h>
// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);
// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif
void setup() {
Serial.begin(115200);
// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {0x38,0x05,0xB8,0xDD,0x15,0xCA,0xB8,0x72,0x1E,0x40,0xBC,0xF1,0x21,0x81,0x45,0x67};
// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x89,0x1C,0xC3,0x15,0xA9,0x0D,0xCD,0xBD,0xC5,0xAA,0x9E,0x28,0xA6,0x93,0x84,0x7B};
/*
* Having your device already registered at cloud.supla.org,
* you want to change CHANNEL sequence or remove any of them,
* then you must also remove the device itself from cloud.supla.org.
* Otherwise you will get "Channel conflict!" error.
*/
auto secretRelay = new Supla::Control::Relay(22, true);
new Supla::Control::Relay(23, true);
new Supla::Control::Relay(24, true);
new Supla::Control::Relay(25, true);
/*
* 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
*
*/
SuplaDevice.begin(GUID, // Global Unique Identifier
"", // SUPLA server address
"", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}
void loop() {
SuplaDevice.iterate();
}
Witam Wszystkich