Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -- New project --
- This source code of graphical user interface
- has been generated automatically by RemoteXY editor.
- To compile this code using RemoteXY library 2.3.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.1.1 or later version;
- - for iOS 1.2.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__ESP8266WIFI_LIB_POINT
- #include <ESP8266WiFi.h>
- #include <RemoteXY.h>
- // RemoteXY connection settings
- #define REMOTEXY_WIFI_SSID "AirRide"
- #define REMOTEXY_WIFI_PASSWORD "12345678"
- #define REMOTEXY_SERVER_PORT 80
- // RemoteXY configurate
- #pragma pack(push, 1)
- uint8_t RemoteXY_CONF[] =
- { 255,5,0,0,0,68,0,8,13,1,
- 1,0,4,30,21,21,2,31,85,112,
- 0,1,0,5,64,18,18,2,31,68,
- 111,119,110,0,1,0,40,31,20,20,
- 2,31,85,112,0,1,0,41,63,19,
- 19,2,31,68,111,119,110,0,1,2,
- 6,86,53,11,2,31,83,104,111,119,
- 77,111,100,101,0 };
- // this structure defines all the variables of your control interface
- struct {
- // input variable
- uint8_t button_1; // =1 if button pressed, else =0
- uint8_t button_2; // =1 if button pressed, else =0
- uint8_t button_3; // =1 if button pressed, else =0
- uint8_t button_4; // =1 if button pressed, else =0
- uint8_t button_5; // =1 if button pressed, else =0
- // other variable
- uint8_t connect_flag; // =1 if wire connected, else =0
- } RemoteXY;
- #pragma pack(pop)
- /////////////////////////////////////////////
- // END RemoteXY include //
- /////////////////////////////////////////////
- #define PIN_BUTTON_1 D0
- #define PIN_BUTTON_2 D1
- #define PIN_BUTTON_3 D2
- #define PIN_BUTTON_4 D3
- #define PIN_BUTTON_5 D4
- void setup()
- {
- RemoteXY_Init ();
- pinMode (PIN_BUTTON_1, OUTPUT);
- pinMode (PIN_BUTTON_2, OUTPUT);
- pinMode (PIN_BUTTON_3, OUTPUT);
- pinMode (PIN_BUTTON_4, OUTPUT);
- pinMode (PIN_BUTTON_5, OUTPUT);
- // TODO you setup code
- }
- void loop()
- {
- RemoteXY_Handler ();
- digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
- digitalWrite(PIN_BUTTON_2, (RemoteXY.button_2==0)?LOW:HIGH);
- digitalWrite(PIN_BUTTON_3, (RemoteXY.button_3==0)?LOW:HIGH);
- digitalWrite(PIN_BUTTON_4, (RemoteXY.button_4==0)?LOW:HIGH);
- digitalWrite(PIN_BUTTON_5, (RemoteXY.button_5==0)?LOW:HIGH);
- if (RemoteXY.button_5==1)
- {
- digitalWrite(PIN_BUTTON_2,HIGH);
- digitalWrite(PIN_BUTTON_4,HIGH);
- delay(2000);
- digitalWrite(PIN_BUTTON_2,LOW);
- digitalWrite(PIN_BUTTON_4,LOW);
- }
- // TODO you loop code
- // use the RemoteXY structure for data transfer
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement