1

Topic: Bored not reply

There is a problem I have a project that I linked to Bluetooth through your platform, but when I try to connect to Bluetooth through your application, a message appears to me (Bored not reply) What is the solution?

This is my code:
/*
   -- Water --
   
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.13 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.14.08 or later version;
     - for iOS 1.11.2 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          //
//////////////////////////////////////////////

// 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 10
#define REMOTEXY_SERIAL_TX 11
#define REMOTEXY_SERIAL_SPEED 9600


#include <RemoteXY.h>

// RemoteXY GUI configuration 
#pragma pack(push, 1) 
uint8_t RemoteXY_CONF[] =   // 107 bytes
  { 255,0,0,13,0,100,0,18,0,0,0,31,1,106,200,1,1,4,0,72,
  6,17,41,41,4,166,140,208,26,0,0,0,0,0,0,122,69,0,0,0,
  0,72,58,18,40,40,4,166,140,37,26,0,0,0,0,0,0,200,66,0,
  0,0,0,72,5,75,40,40,4,166,140,137,26,0,0,0,0,0,0,96,
  65,0,0,0,0,72,58,75,39,39,12,166,140,94,26,0,0,0,0,0,
  0,122,67,0,0,0,0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // output variables
  float tdsValue; // from 0 to 4000
  float temperature; // from 0 to 100
  float phValue; // from 0 to 14
  int8_t turbidity; // from 0 to 250

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;   
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
// Include additional libraries
#include <EEPROM.h>
#include "GravityTDS.h"
#include "max6675.h"

// Pin definitions
#define TdsSensorPin A1
#define thermoDO 4
#define thermoCS 5
#define thermoCLK 6
#define sensorpin A2
#define pHSense A0

// Sensor instances
GravityTDS gravityTds;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

// Global variables
float temperature = 25, tdsValue = 0;
int samples = 10;
float adc_resolution = 1024.0;


void setup()
{

  Serial.begin(9600);
  RemoteXY_Init ();

  // Initialize TDS sensor
  gravityTds.setPin(TdsSensorPin);
  gravityTds.setAref(3.3);
  gravityTds.setAdcRange(1024.0);
  gravityTds.begin();
 
  Serial.println("MAX6675 & pH Sensor Initialization");
 
  // Delay for MAX6675 to stabilize
  delay(500);
 
 
  // TODO you setup code
 
}

float ph(float voltage) {
  return 7 + ((2.65 - voltage) / 0.18);
}

void loop()
{
  RemoteXY_Handler ();
  // Read temperature from thermocouple
  float tempC = thermocouple.readCelsius();
  RemoteXY.temperature = tempC;
 
  // Update TDS sensor temperature and value
  gravityTds.setTemperature(tempC);
  gravityTds.update();
  tdsValue = gravityTds.getTdsValue();
  RemoteXY.tdsValue = tdsValue;
 
  // Read turbidity sensor
  int sensorValue = analogRead(sensorpin);
  int turbidity = map(sensorValue, 0, 750, 100, 0);
  RemoteXY.turbidity = turbidity;

  // Read pH sensor
  int measurings = 0;
  for (int i = 0; i < samples; i++) {
    measurings += analogRead(pHSense);
    delay(10);
  }
   float voltage = 5.0 / adc_resolution * measurings / samples;
  float pHValue = ph(voltage);
  RemoteXY.phValue = pHValue;

  // Debug prints (optional)
  Serial.print("TDS: ");
  Serial.print(tdsValue);
  Serial.println(" ppm");
 
  Serial.print("Temp: ");
  Serial.print(tempC);
  Serial.println(" C");
 
  Serial.print("Turbidity: ");
  Serial.println(turbidity);
 
  Serial.print("pH: ");
  Serial.println(pHValue);
 
  delay(1000);
   


}

2

Re: Bored not reply

void loop() 
{ 
  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 


}

]

2B, or not 2B, that is the pencil ...

3

Re: Bored not reply

Daba
What do you mean ? all the comments you sent I have implemented .

4

Re: Bored not reply

Replase delay() with RemoteXY_delay() in all your code.
The best solution is to write code without delays at all. While the delay is being executed, your code cannot react to external or internal events. For example, it cannot receive data transmitted from the phone.