Compile errors from SparkIntervalTimer - library was not included in code


#1

Hello:

I am porting code that works on a Photon to a Bluz. Basically the Bluz interfaces with a RS485 sensor via a TTL converter. The hardware and wiring has been tested with a Photon. Circuit is below.

I am getting compile errors from the SparkIntervalTimer library but I am not using it?! Please see image below. Any help is appreciated.

Thanks in advance.


#2

That library could use others as dependencies, the author of the Spark Interval library added a clear check for the platform ID unfortunately, so that would have to be changed in order for it to work. You could try contacting the author of the library to make the change.


#3

Hi @eric,

OK I will, but I am not even using this library so I am not sure why it is giving an error? My entire code is below.

===================================

int len;
char buf[60];
unsigned int i = 0;
double measure;

int byteReceived;

void setup()
{
pinMode(D3, OUTPUT); //Set RS485 direction pin as output
digitalWrite(D3, LOW); // Init Transceiver
Particle.variable(“Average”, &measure, DOUBLE);
Serial1.begin(19200);
}

void loop() // run over and over
{

digitalWrite(D3, LOW); // Disable RS485 Transmit
len = Serial1.readBytes((char *)buf,50);

if(len > 0)
{
for (int i=0; i <= len; i++)

{
if (buf[i] == 170)
{
measure = 0.0328084 * (100 * int(buf[i+1]) + (buf[i+2]));
i=i+2;
}
}
Serial.flush();
}
}


#4

From the first screenshot, there is a SoftSerial library included in your code. That may have pulled it in as a dependency. Even if you delete that line, the Web IDE may still compile the code with your app. So you ay need to fully remove the library from your app, or you may need to create a new app and code your code if you can’t remove the library reference.


#5

Thank you @eric. I had not noticed that indeed the library was still there even though I had deleted the include in the code.

I wrote the app again and it compiled fine. Thanks again.


#6

@jimmie, SparkIntervalTimer is a hardware dependent library and won’t run on the Bluz since nRF51822 hardware is very different. The ParticleSoftSerial library depends on SparkIntervaltimer. You will need to look for a Bluz-specific SoftwareSerial library.