SaveText.Ru

Без имени
  1. /*
  2.    -- New project --
  3.    
  4.    This source code of graphical user interface
  5.    has been generated automatically by RemoteXY editor.
  6.    To compile this code using RemoteXY library 2.4.3 or later version
  7.    download by link http://remotexy.com/en/library/
  8.    To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                  
  9.      - for ANDROID 4.5.1 or later version;
  10.      - for iOS 1.4.1 or later version;
  11.    
  12.    This source code is free software; you can redistribute it and/or
  13.    modify it under the terms of the GNU Lesser General Public
  14.    License as published by the Free Software Foundation; either
  15.    version 2.1 of the License, or (at your option) any later version.    
  16. */
  17.  
  18. //////////////////////////////////////////////
  19. //        RemoteXY include library          //
  20. //////////////////////////////////////////////
  21.  
  22. // RemoteXY select connection mode and include library
  23. #define REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD
  24. #include <ESP8266WiFi.h>
  25.  
  26. #include <RemoteXY.h>
  27.  
  28. // RemoteXY connection settings
  29. #define REMOTEXY_WIFI_SSID "nubia"
  30. #define REMOTEXY_WIFI_PASSWORD "12345678"
  31. #define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
  32. #define REMOTEXY_CLOUD_PORT 6376
  33. #define REMOTEXY_CLOUD_TOKEN "efa7491094ef180c66970fca038b5de0"
  34.  
  35.  
  36. // RemoteXY configurate  
  37. #pragma pack(push, 1)
  38. uint8_t RemoteXY_CONF[] =
  39.   { 255,1,0,0,0,29,0,10,13,0,
  40.   2,0,35,21,22,11,2,26,31,31,
  41.   208,146,208,154,208,155,0,208,146,208,
  42.   171,208,154,208,155,0 };
  43.  
  44. // this structure defines all the variables and events of your control interface
  45. struct {
  46.  
  47.     // input variables
  48.   uint8_t switch_1; // =1 if switch ON and =0 if OFF
  49.  
  50.     // other variable
  51.   uint8_t connect_flag;  // =1 if wire connected, else =0
  52.  
  53. } RemoteXY;
  54. #pragma pack(pop)
  55.  
  56. /////////////////////////////////////////////
  57. //           END RemoteXY include          //
  58. /////////////////////////////////////////////
  59.  
  60. #define PIN_SWITCH_1 D0
  61.  
  62.  
  63. void setup()
  64. {
  65.   RemoteXY_Init ();
  66.  
  67.   pinMode (LED_BUILTIN, OUTPUT);
  68.  
  69.   // TODO you setup code
  70.  
  71. }
  72.  
  73. void loop()
  74. {
  75.   RemoteXY_Handler ();
  76.  
  77.   digitalWrite(LED_BUILTIN, (RemoteXY.switch_1==0)?LOW:HIGH);
  78.  
  79.   // TODO you loop code
  80.   // use the RemoteXY structure for data transfer
  81.   // do not call delay()
  82.  
  83.  
  84. }

Share with your friends:

Print