Devices & Components
Arduino Uno Rev3
Breadboard (generic)
LED (generic)
ESP8266 ESP-01
Jumper wires (generic)
Through Hole Resistor, 1 kohm
4xAA battery holder
SG90 Micro-servo motor
LDR, 5 Mohm
Male/Female Jumper Wires
Software & Tools
Arduino IDE
Project description
Code
App Code
arduino
Please change these three things while performing the application; #define REMOTEXY_WIFI_SSID "xxxxxx" #define REMOTEXY_WIFI_PASSWORD "xxxxxxxx" #define REMOTEXY_CLOUD_TOKEN "xxxxxx"
1#include <Servo.h> 2#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD 3#include <RemoteXY.h> 4#define REMOTEXY_SERIAL Serial 5#define REMOTEXY_SERIAL_SPEED 115200 6#define REMOTEXY_WIFI_SSID "xxxxxxxx" 7#define REMOTEXY_WIFI_PASSWORD "xxxxxxxxxxxxx" 8#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com" 9#define REMOTEXY_CLOUD_PORT 6376 10#define REMOTEXY_CLOUD_TOKEN "xxxxxxxxxxx" 11#pragma pack(push, 1) 12uint8_t RemoteXY_CONF[] = 13 { 255,2,0,18,0,89,0,11,31,5, 14 1,0,17,37,29,29,2,1,31,79, 15 78,32,45,32,79,70,70,0,131,1, 16 6,7,20,7,1,12,31,65,80,80, 17 0,131,0,38,7,20,7,2,1,31, 18 84,69,83,84,0,69,0,20,22,25, 19 25,1,12,129,0,22,50,20,6,1, 20 12,68,117,114,117,109,0,67,5,8, 21 61,47,10,1,31,12,16,4,128,16, 22 80,31,10,1,1,26 }; 23struct { 24uint8_t button_1; // =1 if button pressed, else =0 25 int8_t slider_1; // =0..100 slider position 26int16_t sound_1; // =0 no sound, else ID of sound, =1001 for example, look sound list in app 27 char text_1[16]; // string UTF8 end zero 28 uint8_t connect_flag; // =1 if wire connected, else =0 29} RemoteXY; 30#pragma pack(pop) 31#define PIN_BUTTON_1 13 32Servo myservo; 33void setup() 34{ 35 RemoteXY_Init (); 36 myservo.attach(3); 37 pinMode (PIN_BUTTON_1, OUTPUT); 38 RemoteXY.slider_1 = 50; 39 // TODO you setup code 40} 41 42void loop() 43{ 44 45 RemoteXY_Handler (); 46 if (analogRead(A0)>60) 47 { 48 strcpy (RemoteXY.text_1, "Kapı Caliyor"); 49 RemoteXY.sound_1 = 1001; 50 } 51 else 52 { 53 strcpy (RemoteXY.text_1, "Kimse Yok"); 54 RemoteXY.sound_1 = 0; 55 } 56 digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH); 57 58 int ms = RemoteXY.slider_1*20+500; 59 myservo.writeMicroseconds(ms); 60 61 62 63}
Test Code
arduino
Please change these three things while performing the application #define REMOTEXY_WIFI_SSID "xxxxxxxxxxx" #define REMOTEXY_WIFI_PASSWORD "xxxxxxxxxxx" #define REMOTEXY_CLOUD_TOKEN "xxxxxxxx"
1#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD 2#include <RemoteXY.h> 3#define REMOTEXY_SERIAL Serial 4#define REMOTEXY_SERIAL_SPEED 115200 5#define REMOTEXY_WIFI_SSID "xxxxxxxx" //wifi-name 6#define REMOTEXY_WIFI_PASSWORD "xxxxxxxxxxxxxx" //wifi-password 7#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com" 8#define REMOTEXY_CLOUD_PORT 6376 9#define REMOTEXY_CLOUD_TOKEN "xxxxxxxxxxxx" //app - token 10#pragma pack(push, 1) 11uint8_t RemoteXY_CONF[] = 12 { 255,2,0,18,0,89,0,11,31,5, 13 1,0,17,37,29,29,2,1,31,79, 14 78,32,45,32,79,70,70,0,131,1, 15 6,7,20,7,1,12,31,65,80,80, 16 0,131,0,38,7,20,7,2,1,31, 17 84,69,83,84,0,69,0,20,22,25, 18 25,1,12,129,0,22,50,20,6,1, 19 12,68,117,114,117,109,0,67,5,8, 20 61,47,10,1,31,12,16,4,128,16, 21 80,31,10,1,1,26 }; 22struct { 23uint8_t button_1; // =1 if button pressed, else =0 24 int8_t slider_1; // =0..100 slider position 25 int16_t sound_1; // =0 no sound, else ID of sound, =1001 for example, look sound list in app 26 char text_1[16]; // string UTF8 end zero 27 uint8_t connect_flag; // =1 if wire connected, else =0 28} RemoteXY; 29#pragma pack(pop) 30#define PIN_BUTTON_1 13 31void setup() 32{ 33 RemoteXY_Init (); 34 pinMode (PIN_BUTTON_1, OUTPUT); 35} 36void loop() 37{ 38 RemoteXY_Handler (); 39 digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH); 40}
App Code
arduino
Please change these three things while performing the application; #define REMOTEXY_WIFI_SSID "xxxxxx" #define REMOTEXY_WIFI_PASSWORD "xxxxxxxx" #define REMOTEXY_CLOUD_TOKEN "xxxxxx"
1#include <Servo.h> 2#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD 3#include 4 <RemoteXY.h> 5#define REMOTEXY_SERIAL Serial 6#define REMOTEXY_SERIAL_SPEED 7 115200 8#define REMOTEXY_WIFI_SSID "xxxxxxxx" 9#define REMOTEXY_WIFI_PASSWORD 10 "xxxxxxxxxxxxx" 11#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com" 12#define 13 REMOTEXY_CLOUD_PORT 6376 14#define REMOTEXY_CLOUD_TOKEN "xxxxxxxxxxx" 15#pragma 16 pack(push, 1) 17uint8_t RemoteXY_CONF[] = 18 { 255,2,0,18,0,89,0,11,31,5, 19 20 1,0,17,37,29,29,2,1,31,79, 21 78,32,45,32,79,70,70,0,131,1, 22 6,7,20,7,1,12,31,65,80,80, 23 24 0,131,0,38,7,20,7,2,1,31, 25 84,69,83,84,0,69,0,20,22,25, 26 25,1,12,129,0,22,50,20,6,1, 27 28 12,68,117,114,117,109,0,67,5,8, 29 61,47,10,1,31,12,16,4,128,16, 30 80,31,10,1,1,26 31 }; 32struct { 33uint8_t button_1; // =1 if button pressed, else =0 34 int8_t 35 slider_1; // =0..100 slider position 36int16_t sound_1; // =0 no sound, else ID 37 of sound, =1001 for example, look sound list in app 38 char text_1[16]; // string 39 UTF8 end zero 40 uint8_t connect_flag; // =1 if wire connected, else =0 41} RemoteXY; 42#pragma 43 pack(pop) 44#define PIN_BUTTON_1 13 45Servo myservo; 46void setup() 47{ 48 49 RemoteXY_Init (); 50 myservo.attach(3); 51 pinMode (PIN_BUTTON_1, OUTPUT); 52 53 RemoteXY.slider_1 = 50; 54 // TODO you setup code 55} 56 57void loop() 58{ 59 60 61 RemoteXY_Handler (); 62 if (analogRead(A0)>60) 63 { 64 strcpy (RemoteXY.text_1, 65 "Kapı Caliyor"); 66 RemoteXY.sound_1 = 1001; 67 } 68 else 69 { 70 71 strcpy (RemoteXY.text_1, "Kimse Yok"); 72 RemoteXY.sound_1 = 0; 73 } 74 75 digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH); 76 77 int ms = 78 RemoteXY.slider_1*20+500; 79 myservo.writeMicroseconds(ms); 80 81 82 83}
Downloadable files
App Diagram
App Diagram

Test Diagram
Test Diagram

Test Diagram
Test Diagram

App Diagram
App Diagram

Comments
Only logged in users can leave comments