EmStat Pico with Arduino -- Error

I want to connect my EmStat Pico with an arduino Micro. I downloaded the files for the Arduino Example from https://github.com/PalmSens/emstatpico/tree/master/MethodSCRIPTExample_Arduino. After including the MothodSCRIPT C libraries from the MethodSCRIPTComm folder and the MathHelperLibrary in MethodSCRIPTExample.ino, I try compile the sketch but an error comes up:

C:\......\MethodSCRIPTExample\MethodSCRIPTExample.ino: In function 'void loop()':
MethodSCRIPTExample:271:29: error: 'HUGE_VALF' was not declared in this scope
if (data.zreal != HUGE_VALF)
exit status 1
'HUGE_VALF' was not declared in this scope

I have checked that the libraries included are correct but the error persists.

Also, I noticed that the code in the Example is:

 extern "C" {
#include <MSComm.h>
#include <MathHelpers.h>
#include <Arduino.h>

but the PDF notes (https://github.com/PalmSens/emstatpico/blob/master/MethodSCRIPTExample_Arduino/GettingStarted_MethodSCRIPT_Example_Arduino.pdf) say:

extern "C" {
#include <MSComm.h>
#include <MathHelpers.C>

Has this anything to do with the error? How can I solve this?

Thank you!

  • The compile error appeared to be caused by HUGE_VALF not being present in the AVR (ATmega) math.h library. Thank you for pointing this out. We have updated the library to use `INFINITY` instead of `HUGE_VALF` to let the program compile. Also, the include should be "MathHelpers.h" instead of "MathHelpers.c", which is also corrected in this update. This version can be found at the emstatpico GIthub repository.

    We do recommend using the Arduino MKR Zero for the EmStat Pico example since that is the board on which the examples were developed and tested. The ARM based Arduino also has a lot more processing power and RAM, so it can keep up better with the data stream from the EmStat Pico.