podłączenie supla pod arduino
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
pewnie bym musiał dać to pod pin jakiś i dać jezeli na pinie 9 jest stan wysoki ustaw na pinie 8 stan niski bo chyba przekaźnik załącza sie na stanie niskim
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
to masz jakiś pomyśł na kod abym to wszystko połączył w jedno bo jak mówiłem ja jestem zielony tyle co kiedyś zrobiłem przekaźniki na pilota
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
no i pierwsze przemyślenia o problemy czy przekaźniki wytrzymają np podłączenie komputera albo starowaniem światłem w pokoju
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
a jeszcze takie małe pytanie porty arduino programuje sie przez strone czy jakoś inaczej bo nie jest to nigdzie wyjaśnione
-
pzygmunt
- Posts: 20302
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
- Been thanked: 59 times
1. To zależy jakich przekaźników użyjesz
2. Porty konfiguruje się w programie, który wgrywasz do Arduino. Tutaj należałoby mówić o PIN-ach, a nie portach.
W przykładach dołączonych do biblioteki dla Arduino masz to opisane.
W parametrach wywołania funkcji addRelay (metody - mówiąc prawidłowo), określasz numer pinu na którym "wisi" przekaźnik.
SuplaDevice.addRelay(44); i jest to pin 44
https://github.com/SUPLA/arduino/blob/m ... ld.ino#L32
2. Porty konfiguruje się w programie, który wgrywasz do Arduino. Tutaj należałoby mówić o PIN-ach, a nie portach.
W przykładach dołączonych do biblioteki dla Arduino masz to opisane.
W parametrach wywołania funkcji addRelay (metody - mówiąc prawidłowo), określasz numer pinu na którym "wisi" przekaźnik.
SuplaDevice.addRelay(44); i jest to pin 44
https://github.com/SUPLA/arduino/blob/m ... ld.ino#L32
SUPLA.... Nareszcie w domu.
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
no ok kumam ale teraz kolejny problem nie mogę wgrać progamu do pingu ani supla błąd kompilacji korzystam z klona megi r3 (zgony)
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
jak na razie kolejny problem nie moge wgrać programu jakbyś mógł zrobić jakiś poradnik np z jakiej strony uzyskać GUID do programu co gdzie wklejać pisze ale albo dzis jest za pózno albo ja czegoś nie kumam był bym wdzięczny jakbyś mi wytłumaczył co i jak bo nie wiem gdzie mam błędy
#include <UIPEthernet.h>
#include <SuplaDevice.h>
/*
* SUPLA DEVICE - ARDUINO - ENC28J60
* Author: Przemyslaw Zygmunt <[email protected]>
*
* This example requires UIPEthernet library installed.
* https://github.com/ntruchsess/arduino_uip
*/
void setup() {
Serial.begin(9600);
// Replace the falowing GUID
char GUID[SUPLA_GUID_SIZE] = {0xB4,0x90,0x9A,0x9B,0xD7,0x1B,0x1B,0x1F,0x41,0x91,0xC9,0x42,0x68,0xBD,0x23,0xAC};
// with GUID that you can retrieve from https://www.supla.org/arduino/get-guid
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
/*
* 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.
*/
// CHANNEL0 - RELAY
SuplaDevice.addRelay(44); // 44 - Pin number where the relay is connected
// Call SuplaDevice.addRelay(44, true) with an extra "true" parameter
// to enable "port value inversion"
// where HIGH == LOW, and LOW == HIGH
// CHANNEL1 - RELAY
SuplaDevice.addRelay(45); // 45 - Pin number where the relay is connected
// CHANNEL3 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(46, // 46 - Pin number where the 1st relay is connected
47); // 47 - Pin number where the 2nd relay is connected
// CHANNEL4 - Opening sensor (Normal Open)
SuplaDevice.addSensorNO(A0); // A0 - Pin number where the sensor is connected
// Call SuplaDevice.addSensorNO(A0, true) with an extra "true" parameter
// to enable the internal pull-up resistor
// CHANNEL5 - Opening sensor (Normal Open)
SuplaDevice.addSensorNO(A1); // A1 - Pin number where the sensor is connected
/*
* SuplaDevice Initialization.
* Server address, LocationID and LocationPassword are 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
mac, // Ethernet MAC address
"svr1.supla.org", // SUPLA server address
100, // Location ID
"y0tM "); // Location Password
}
void loop() {
SuplaDevice.iterate();
}
#include <UIPEthernet.h>
#include <SuplaDevice.h>
/*
* SUPLA DEVICE - ARDUINO - ENC28J60
* Author: Przemyslaw Zygmunt <[email protected]>
*
* This example requires UIPEthernet library installed.
* https://github.com/ntruchsess/arduino_uip
*/
void setup() {
Serial.begin(9600);
// Replace the falowing GUID
char GUID[SUPLA_GUID_SIZE] = {0xB4,0x90,0x9A,0x9B,0xD7,0x1B,0x1B,0x1F,0x41,0x91,0xC9,0x42,0x68,0xBD,0x23,0xAC};
// with GUID that you can retrieve from https://www.supla.org/arduino/get-guid
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
/*
* 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.
*/
// CHANNEL0 - RELAY
SuplaDevice.addRelay(44); // 44 - Pin number where the relay is connected
// Call SuplaDevice.addRelay(44, true) with an extra "true" parameter
// to enable "port value inversion"
// where HIGH == LOW, and LOW == HIGH
// CHANNEL1 - RELAY
SuplaDevice.addRelay(45); // 45 - Pin number where the relay is connected
// CHANNEL3 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(46, // 46 - Pin number where the 1st relay is connected
47); // 47 - Pin number where the 2nd relay is connected
// CHANNEL4 - Opening sensor (Normal Open)
SuplaDevice.addSensorNO(A0); // A0 - Pin number where the sensor is connected
// Call SuplaDevice.addSensorNO(A0, true) with an extra "true" parameter
// to enable the internal pull-up resistor
// CHANNEL5 - Opening sensor (Normal Open)
SuplaDevice.addSensorNO(A1); // A1 - Pin number where the sensor is connected
/*
* SuplaDevice Initialization.
* Server address, LocationID and LocationPassword are 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
mac, // Ethernet MAC address
"svr1.supla.org", // SUPLA server address
100, // Location ID
"y0tM "); // Location Password
}
void loop() {
SuplaDevice.iterate();
}
