UKHeliBob:
What, in your opinion, is the correct place ?
Can you put the code that you want to change in its own function and on its own tab in the IDE? If so, then within reason it won't matter where it is within the final code.
That really takes away the simplicity of copying the code block from the web-development platform in its entirety, and simply pasting it over ALL of the contents of that tab. If I then have to remake a function out of it, I'm gaining nothing.
According to RemoteXY instructions, this code block should precede void setup() and void loop(), but perhaps I'm stuck in old ways, having programmed (poorly) in BASIC so many years ago.
Here's what the block looks like, this is for a single pushbutton and 1 LED interface.....
/*
-- Button_LED --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.3.5 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.3.1 or later version;
- for iOS 1.3.5 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__SOFTSERIAL
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,1,0,28,0,8,13,0,
1,2,12,24,47,12,2,31,80,114,
101,115,115,32,109,101,32,33,0,65,
4,69,23,16,16 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t button; // =1 if button pressed, else =0
// output variable
uint8_t led_r; // =0..255 LED Red brightness
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
void setup()
{
RemoteXY_Init ();
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
// TODO you loop code
// use the RemoteXY structure for data transfer
}
But I just extract the middle part, enclosed in all those /////'s, and paste it over the block that is already in my sketch. I thought I would be able to just put this on its own tab, and use some sort of include.
It's straightforward, click-drag the source from the web-page, Ctrl-C, click drag the block I want to replace in my sketch, Ctrl-V. Just thought I might be able to eliminate one of those click-drags with a Ctrl-A.
This configurate block can get quite large, so click-dragging and scrolling can take a few precious seonds....