Извините, русский язык здесь недоступен — пожалуйста, воспользуйтесь Google Translate для перевода.
The Option Selector element is strait forward. Each option in the list has a position and value associated with that position, with values starting at the top with 0 and increasing with each step progressing down the list. The prompts are set in the editor and are not changed or known to the controller except for the prompt's (text's) location (position value) within the option list.
If no option is selected (displays "Customer List"), the optionSelector_01 value is 0 and 0 is sent to the controller.
If Name is selected, the optionSelector_01 value is 1 and 1 is sent to the controller.
If Address is selected, the optionSelector_01 value is 2 and 2 is sent to the controller.
If City is selected, the optionSelector_01 value is 3 and 3 is sent to the controller.
If Phone Number is selected, the optionSelector_01 value is 4 and 4 is sent to the controller.
The text in the Option Selector element is not sent to the controller. Only the text's relative position within the list is sent. The controller has to decide what it wants to do with the selected text's position information.
/*
-- Test Option Selector Element --
To compile this code using RemoteXY library 4.1.8 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.18.03 or later version;
- for iOS 1.14.1 or later version;
To interact with the GUI, please refer to the manual:
https://remotexy.com/ru/help/code/interaction/
This source code was automatically generated by the RemoteXY editor and
is an example for the RemoteXY library.
Licensed under the MIT License. See the LICENSE file in the RemoteXY library
root (https://github.com/RemoteXY/RemoteXY-Arduino-library) for full license
details.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
#define REMOTEXY_ACCESS_PASSWORD "1234"
#include <RemoteXY.h>
// RemoteXY GUI configuration
#pragma pack(push, 1)
uint8_t const PROGMEM RemoteXY_CONF_PROGMEM[] = // 149 bytes V19
{ 255,1,0,1,0,142,0,19,0,0,0,79,112,116,105,111,110,32,83,101,
108,101,99,116,111,114,32,84,101,115,116,105,110,103,0,31,1,106,200,1,
1,4,0,12,21,32,70,10,195,30,26,67,117,115,116,111,109,101,114,32,
76,105,115,116,0,78,97,109,101,0,65,100,100,114,101,115,115,0,67,105,
116,121,0,80,104,111,110,101,32,78,117,109,98,101,114,0,129,17,110,78,
12,64,17,67,117,114,114,101,110,116,32,79,112,116,105,111,110,0,67,33,
143,40,10,93,2,26,129,17,123,80,12,64,17,83,101,108,101,99,116,111,
114,32,86,97,108,117,101,58,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t optionSelector_01; // from 0 to 5
// output variables
int8_t current_value_01; // -128 .. 127
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
void RemoteXY_optionSelector_01_event() {
// TODO: RemoteXY.optionSelector_01 was changed
RemoteXY.current_value_01 = RemoteXY.optionSelector_01; // Display the current selection's value
}
void setup()
{
RemoteXY_Init (); // initialization by macros
RemoteXYEngine.addVariableEvent (RemoteXY.optionSelector_01, RemoteXY_optionSelector_01_event);
// TODO you setup code
}
void loop()
{
RemoteXYEngine.handler ();
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay(), use instead RemoteXYEngine.delay()
}