1 (edited by faust 2024-02-13 21:05:21)

Topic: 'RemoteXY_Init' was not declared in this scope

C:\Users\Matt\Downloads\project-2024-02-13-23-48-18\project\project.ino: In function 'void setup()':
C:\Users\Matt\Downloads\project-2024-02-13-23-48-18\project\project.ino:96:1: error: 'RemoteXY_Init' was not declared in this scope


Im sure its basic, but what have i missed - library is installed

this was the Arduino, USB otg example

2

Re: 'RemoteXY_Init' was not declared in this scope

In the example of the library for USB OTG there is no such function. Perhaps you changed something?

#include <RemoteXY.h>

// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,1,0,27,0,10,13,2,
  1,0,9,9,46,46,6,7,50,50,
  2,31,88,0,65,4,62,16,31,31,
  14,62,35,35 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_1_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          //
/////////////////////////////////////////////


CRemoteXY *remotexy;

void setup() 
{

  remotexy = new CRemoteXY (
    RemoteXY_CONF_PROGMEM, 
    &RemoteXY, 
    new CRemoteXYStream_HardSerial (
      &Serial,       
      115200     // REMOTEXY_SERIAL_SPEED
    )
  ); 
  
  
  // TODO you setup code
  
}

void loop()        
{ 
  remotexy->handler ();
  
  if (RemoteXY.button_1)  RemoteXY.led_1_r = 255;
  else RemoteXY.led_1_r = 0;
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


}

3

Re: 'RemoteXY_Init' was not declared in this scope

ok, well i figured out that the message was some the script i made in the editor, adn that when i clicked the example it does not load into the Arduino IDE....i found it on my harddrive and it is a pde file, not a ino.....
I opened the pde in notepad and copied it into the Arduino IDE, adn it downloaded to my Mega 2560...
connected it to my Android setup, ran RemoteXY and tried to add the Mega ...but it just says "USB device not Permission"

4

Re: 'RemoteXY_Init' was not declared in this scope

faust wrote:

...but it just says "USB device not Permission"

If your OS is Android 12 or higher, you need to update the RemoteXY app to version 4.13.3. The version will be available on the Play Store soon. Before Android 11 this problem does not exist.