podłączenie supla pod arduino
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
ok a jak zastosować odwrotnie program go moje przekaźniki są załączane stanem niskim
-
pzygmunt
- Posts: 20302
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
- Been thanked: 59 times
Przez ustawienie hiIsLo na true
https://github.com/SUPLA/arduino/blob/m ... laDevice.h
bool addRelay(int relayPin1, int relayPin2, bool hiIsLo, _supla_int_t functions);
bool addRelay(int relayPin1, int relayPin2, bool hiIsLo);
bool addRelay(int relayPin1, bool hiIsLo);
bool addRollerShutterRelays(int relayPin1, int relayPin2, bool hiIsLo);
np SuplaDevice.addRelay(44, true);
https://github.com/SUPLA/arduino/blob/m ... laDevice.h
bool addRelay(int relayPin1, int relayPin2, bool hiIsLo, _supla_int_t functions);
bool addRelay(int relayPin1, int relayPin2, bool hiIsLo);
bool addRelay(int relayPin1, bool hiIsLo);
bool addRollerShutterRelays(int relayPin1, int relayPin2, bool hiIsLo);
np SuplaDevice.addRelay(44, true);
SUPLA.... Nareszcie w domu.
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
ok a teraz pytanie o ustawienie czujnika temperatury
-
pzygmunt
- Posts: 20302
- Joined: Tue Jan 19, 2016 9:26 am
- Location: Paczków
- Been thanked: 59 times
Przykłady:
https://github.com/SUPLA/arduino/blob/m ... rature.ino
https://github.com/SUPLA/arduino/blob/m ... ld_DHT.ino
https://github.com/SUPLA/arduino/blob/m ... rature.ino
https://github.com/SUPLA/arduino/blob/m ... ld_DHT.ino
SUPLA.... Nareszcie w domu.
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
nie wiem co mam nie tak ale powinno być oki a nawet na stronie nie pokazuje sie
#include <SPI.h>
#include <Ethernet.h>
#include <DHT.h>
#include <SuplaDevice.h>
/*
* SUPLA DEVICE - ARDUINO - ETHERNET SHIELD & DHT SENSOR
* Author: Przemyslaw Zygmunt <[email protected]>
*
* This example requires DHT sensor library installed.
* https://github.com/adafruit/DHT-sensor-library
*/
#define DHTPIN 24
#define DHTTYPE DHT11
// Setup a DHT instance
DHT dht(DHTPIN, DHTTYPE);
// DS18B20 Sensor read implementation
void get_temperature_and_humidity(int channelNumber, double *temp, double *humidity) {
*temp = dht.readTemperature();
*humidity = dht.readHumidity();
if ( isnan(*temp) || isnan(*humidity) ) {
*temp = -275;
*humidity = -1;
}
}
void setup() {
Serial.begin(9600);
// Init DHT library
dht.begin();
// Set temperature/humidity callback
SuplaDevice.setTemperatureHumidityCallback(&get_temperature_and_humidity);
// Replace the falowing GUID
char GUID[SUPLA_GUID_SIZE] = {0x64,0xE3,0x2C,0x29,0x42,0x54,0x7C,0x6C,0xD9,0xF2,0xBA,0xA8,0x5F,0x38,0xC4,0xEB};
// 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, true); // 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, true); // 45 - Pin number where the relay is connected
// CHANNEL2 - RELAY
SuplaDevice.addRelay(46, true);
// CHANNEL3 - RELAY
SuplaDevice.addRelay(47, true);
// 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
// CHANNEL6 - DHT11 Sensor
// SuplaDevice.addDHT11();
// SuplaDevice.addAM2302();
SuplaDevice.addDHT11();
/*
* 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
#include <SPI.h>
#include <Ethernet.h>
#include <DHT.h>
#include <SuplaDevice.h>
/*
* SUPLA DEVICE - ARDUINO - ETHERNET SHIELD & DHT SENSOR
* Author: Przemyslaw Zygmunt <[email protected]>
*
* This example requires DHT sensor library installed.
* https://github.com/adafruit/DHT-sensor-library
*/
#define DHTPIN 24
#define DHTTYPE DHT11
// Setup a DHT instance
DHT dht(DHTPIN, DHTTYPE);
// DS18B20 Sensor read implementation
void get_temperature_and_humidity(int channelNumber, double *temp, double *humidity) {
*temp = dht.readTemperature();
*humidity = dht.readHumidity();
if ( isnan(*temp) || isnan(*humidity) ) {
*temp = -275;
*humidity = -1;
}
}
void setup() {
Serial.begin(9600);
// Init DHT library
dht.begin();
// Set temperature/humidity callback
SuplaDevice.setTemperatureHumidityCallback(&get_temperature_and_humidity);
// Replace the falowing GUID
char GUID[SUPLA_GUID_SIZE] = {0x64,0xE3,0x2C,0x29,0x42,0x54,0x7C,0x6C,0xD9,0xF2,0xBA,0xA8,0x5F,0x38,0xC4,0xEB};
// 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, true); // 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, true); // 45 - Pin number where the relay is connected
// CHANNEL2 - RELAY
SuplaDevice.addRelay(46, true);
// CHANNEL3 - RELAY
SuplaDevice.addRelay(47, true);
// 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
// CHANNEL6 - DHT11 Sensor
// SuplaDevice.addDHT11();
// SuplaDevice.addAM2302();
SuplaDevice.addDHT11();
/*
* 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
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
wlasnie w tym problem ze konsola milczy nic sie nie pojawia
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
to pisze
Register in progress
Not connected
Register in progress
Not connected
-
radzisko123
- Posts: 23
- Joined: Tue Jul 26, 2016 8:51 am
teraz nie wiem ale chyba nie albo na samym początku
a inny program działa prawidłowo
a inny program działa prawidłowo
