elektronist34
Üye
- Katılım
- 19 Eyl 2020
- Mesajlar
- 60
- Puanları
- 1
- Yaş
- 42
Serial.begin(115200);
delay(100);
// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF
// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.5.1 or later version;
- for iOS 1.4.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,30,0,10,13,0,
1,0,25,17,12,12,6,31,88,0,
2,0,47,18,22,11,1,26,31,31,
79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_1; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10
void setup()
{
RemoteXY_Init ();
pinMode (PIN_BUTTON_1, OUTPUT);
pinMode (PIN_SWITCH_1, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
#include <ESP8266WiFi.h>
/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.5.1 or later version;
- for iOS 1.4.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#include <ESP8266WiFi.h>
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,30,0,10,13,0,
1,0,25,17,12,12,6,31,88,0,
2,0,47,18,22,11,1,26,31,31,
79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_1; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10
void setup()
{
Serial.begin(115200);
delay(100);
// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF
// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
RemoteXY_Init ();
pinMode (PIN_BUTTON_1, OUTPUT);
pinMode (PIN_SWITCH_1, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
Serial.begin(115200);
delay(100);
/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.5.1 or later version;
- for iOS 1.4.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#include <ESP8266WiFi.h>
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,30,0,10,13,0,
1,0,25,17,12,12,6,31,88,0,
2,0,47,18,22,11,1,26,31,31,
79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_1; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10
void setup()
{
Serial.begin(115200);
delay(100);
// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF
// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
RemoteXY_Init ();
pinMode (PIN_BUTTON_1, OUTPUT);
pinMode (PIN_SWITCH_1, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
WiFi.begin("ssid", "pass");
WiFi.begin(REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD);
kullandığınız modemin bilgileri olmalı. Yani herhangi bir cihaz, cep telefonu gibi esp de modem üzerinden internete çıkmış olacak. Ondan sonrası RemoteXY.com için bir üyelik ve My Projects üzerinden uzaktan kontrol ekranı tasarımı yapmanız. Bu ekranda button_1 ve switch_1 şeklinde iki nesne tanımlamanız gerekiyor ki program içinden kontrol edebilesiniz. Daha sonra sağ üstteki Get source code kısmından tasarımınız için oluşturulan aşağıdaki kısmı kendi modem adınız ve şifresiyle değiştirerek arduino kodunuz içerisine uygun yere eklemeniz yeterli. Daha sonra kodda veya tasarımda yapacağınız değişiklikler için sırf bu kısmı kopyalamanız size hız kazandıracaktır. My tokens'den bir adet her bir program için kullanılmak üzere token/anahtar oluşturmayı unutmayın. RemoteXY'de 5 nesneye kadar ücretsiz, daha fazlasında her 30 saniyede ekran kapanıyor bilginize.#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
Bu da kendi hazırladığım ekran tasarımı. 2 adet 5v röle ve dht11 sensöründen gelen sıcaklık ve nem değerlerini gösteriyor. X şeklindeki switch ise ikinci röleyi basılınca açıksa kapatıyor kapalıysa açıyor. Yani tersliyor.// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "modem_adi"
#define REMOTEXY_WIFI_PASSWORD "modem_şifresi,!."
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "1a81234f745459a76cf123132sdf32040f7e75123453534ea061b5ea"
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,3,0,22,0,65,0,10,180,1,
1,2,22,13,18,18,36,31,88,0,
67,5,11,77,18,8,67,26,11,67,
5,34,77,18,8,179,26,11,2,1,
6,44,22,11,132,26,31,31,79,78,
0,79,70,70,0,2,1,34,44,22,
11,132,26,31,31,79,78,0,79,70,
70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_role1; // =1 if switch ON and =0 if OFF
uint8_t switch_role2; // =1 if switch ON and =0 if OFF
// output variables
char SICAKLIK[11]; // string UTF8 end zero
char NEM[11]; // string UTF8 end zero
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
void loop()
{
RemoteXY_Handler ();
if (RemoteXY.button_1==0)
digitalWrite(PIN_ROLE1, (RemoteXY.switch_role1==0)?HIGH:LOW);
else
digitalWrite(PIN_ROLE1, (RemoteXY.switch_role1==0)?LOW:HIGH);
float sicaklik = dht11_sensor.readTemperature();
float nem = dht11_sensor.readHumidity();
digitalWrite(PIN_ROLE2, (RemoteXY.switch_role2==0)?HIGH:LOW);
dtostrf(sicaklik, 0, 1, RemoteXY.SICAKLIK);
dtostrf(nem, 0, 1, RemoteXY.NEM);
delay(1000);
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?