lgt8fx icon indicating copy to clipboard operation
lgt8fx copied to clipboard

RemoteXY won't compile wiht lgt8f

Open navr32 opened this issue 4 years ago • 2 comments

Hi all ! Many thanks. And congratulation for all the job done by all of contributors. It's woohoo... I have done some little project with the lgt8f328 since some time and start with the wavgat package first..after i found yours and this very very good and promising for futur. Now i try to do more big project and want to drive little HMI with bluetooth by RemoteXY throught my phone with softwareserial but failing..

When i build the remoteXY for the Atmega328p all is ok..but if i try with the Lgt8f328 board set the build crash..here the report..someone have an idea ? I have test with Arduino 1.8.10 to 1.8.13...and RemoteXY ver 2.4.6 and 2.4.5 install from the Arduino IDE libraries manager Here the output of build


In file included from /home/nico/Arduino/libraries/RemoteXY/src/RemoteXY.h:168:0, from /home/nico/Arduino/libraries/RemoteXY/examples/Bluetooth/Bluetooth_HC05_SoftSerial/Bluetooth_HC05_SoftSerial.pde:35: /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h: In constructor 'CRemoteXY::CRemoteXY(const void*, void*, const char*, uint8_t, uint8_t, long int)': /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:18:5: error: 'initSerial' was not declared in this scope initSerial (_serialRx, _serialTx, _serialSpeed); ^~~~~~~~~~ /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:18:5: note: suggested alternative: 'Serial' initSerial (_serialRx, _serialTx, _serialSpeed); ^~~~~~~~~~ Serial /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h: In member function 'virtual void CRemoteXY::sendByte(uint8_t)': /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:26:5: error: 'serial' was not declared in this scope serial->write (b); ^~~~~~ /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:26:5: note: suggested alternative: 'Serial' serial->write (b); ^~~~~~ Serial /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h: In member function 'virtual uint8_t CRemoteXY::receiveByte()': /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:33:17: error: 'serial' was not declared in this scope uint8_t b = serial->read (); ^~~~~~ /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:33:17: note: suggested alternative: 'Serial' uint8_t b = serial->read (); ^~~~~~ Serial /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h: In member function 'virtual uint8_t CRemoteXY::availableByte()': /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:42:12: error: 'serial' was not declared in this scope return serial->available (); ^~~~~~ /home/nico/Arduino/libraries/RemoteXY/src/modules/serial.h:42:12: note: suggested alternative: 'Serial' return serial->available (); ^~~~~~ Serial exit status 1 Erreur de compilation pour la carte LGT8F328



the code example:

RemoteXY example. 
  Smartphone connect via bluetooth HC-05 module
  (software serial connected).

  This shows an example of using the library RemoteXY.
  In the example you can control the LED pin 13 using the button on the 
  smartphone. The example uses the SoftwareSerial library. You need to 
  connect Bluetooth module HC-04(05,06,07) or similar specified contacts: 
  Pin 2(RX) ---  TX Bluetooth module           
  android app, as it will determine which interface you have 
  downloaded the arduino.
  
*/

///////////////////////////////////////////// 
//        RemoteXY include library         // 
///////////////////////////////////////////// 

/* RemoteXY select connection mode and include library */ 
#define REMOTEXY_MODE__HC05_SOFTSERIAL 
#include <SoftwareSerial.h> 
#include <RemoteXY.h> 
  Pin 3(TX) ---  RX Bluetooth module    
  
  Download the mobile app from the 
  website: http://remotexy.com/download/ for connect this sketch.
  
  Use the website http://remotexy.com/ to create your own management 
  interface your arduino with your smartphone or tablet.
  You can create different management interfaces. Use buttons, 
  switches, sliders, joysticks (g-sensor) all colors and sizes 
  in its interface. Next, you will be able to get the sample 
  code for arduino to use your interface for control from a 
  smartphone or tablet. You will not need to re-install the 

/* RemoteXY connection settings */ 
#define REMOTEXY_SERIAL_RX 2 
#define REMOTEXY_SERIAL_TX 3 
#define REMOTEXY_SERIAL_SPEED 9600 

/* RemoteXY configurate  */ 
unsigned char RemoteXY_CONF[] = 
  { 1,0,11,0,1,5,1,0,21,2
  ,59,59,2,88,0 }; 
   
/* this structure defines all the variables of your control interface */ 
struct { 

    /* input variable */
  unsigned char button_1; /* =1 if button pressed, else =0 */

    /* other variable */
  unsigned char connect_flag;  /* =1 if wire connected, else =0 */

} RemoteXY; 

///////////////////////////////////////////// 
//           END RemoteXY include          // 
///////////////////////////////////////////// 

#define PIN_BUTTON_1 13


void setup()  
{ 
  RemoteXY_Init ();  
   
  pinMode (PIN_BUTTON_1, OUTPUT);
   

  // TODO you setup code 
   
} 

void loop()  
{  
  RemoteXY_Handler (); 
   
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
   

  // TODO you loop code 
  // use the RemoteXY structure for data transfer 


}

``

navr32 avatar Nov 06 '20 14:11 navr32

Ok, I think it's because the current (and new) SoftwareSerial implementation does not defines SoftwareSerial_h (it defines SoftwareSerialLGT_h instead).

I've looked at the remoteXY repo here : https://github.com/RemoteXY/RemoteXY-Arduino-library/tree/master/src And everything seems to be headers.

So, maybe you could temporarily solve this issue by adding : #define SoftwareSerial_h before your #include <RemoteXY.h>.

SuperUserNameMan avatar Nov 06 '20 14:11 SuperUserNameMan

Hi SuperUserNameMan ! Your Workaround wok perfectly wonderfull ...wow very cool. Now the Build is OK. I have to test with hardware now to see if working Right. Many thanks..I will tell you if this work.Have a nice day..and week.

navr32 avatar Nov 06 '20 18:11 navr32

Did this change get incorporated into the library at some point? If so, please close this issue.

dwillmore avatar Jan 12 '23 19:01 dwillmore

Yes, it's the same as #65

dbuezas avatar Jan 12 '23 19:01 dbuezas

I am facing the same issue but defining softwareserial didn't solve it

luvaibhuriwala avatar May 14 '23 08:05 luvaibhuriwala