Skip to content

Compilation Error on Wemos D1 Mini #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AbirKuundu opened this issue Mar 1, 2018 · 4 comments
Closed

Compilation Error on Wemos D1 Mini #9

AbirKuundu opened this issue Mar 1, 2018 · 4 comments

Comments

@AbirKuundu
Copy link

When I compile Example8_SPO2 on Arduino Nano, it compiles perfectly. When I try to change the board and compile it on Wemos D1 Mini or NodeMCU 1.0, it throws compilation error like below:

Arduino: 1.8.5 (Windows 10), Board: "WeMos D1 mini Pro, 80 MHz, 16M (15M SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 921600"

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:89:1: error: expected identifier before '{' token

{

^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:89:1: error: expected ')' before '{' token

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp: In function 'void maxim_heart_rate_and_oxygen_saturation(uint32_t*, int32_t, uint32_t*, int32_t*, int8_t*, int)':

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:134:6: error: 'pn_heart_rate' was not declared in this scope

 *pn_heart_rate =(int32_t)( (FS*60)/ n_peak_interval_sum );

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:135:6: error: 'pch_hr_valid' was not declared in this scope

 *pch_hr_valid  = 1;

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:138:6: error: 'pn_heart_rate' was not declared in this scope

 *pn_heart_rate = -999; // unable to calculate because # of peaks are too small

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:139:6: error: 'pch_hr_valid' was not declared in this scope

 *pch_hr_valid  = 0;

  ^

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:89:1: error: expected identifier before '{' token

{

^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:89:1: error: expected ')' before '{' token

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp: In function 'void maxim_heart_rate_and_oxygen_saturation(uint32_t*, int32_t, uint32_t*, int32_t*, int8_t*, int)':

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:134:6: error: 'pn_heart_rate' was not declared in this scope

 *pn_heart_rate =(int32_t)( (FS*60)/ n_peak_interval_sum );

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:135:6: error: 'pch_hr_valid' was not declared in this scope

 *pch_hr_valid  = 1;

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:138:6: error: 'pn_heart_rate' was not declared in this scope

 *pn_heart_rate = -999; // unable to calculate because # of peaks are too small

  ^

C:\Users\abir.kundu\Documents\Arduino\libraries\SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library\src\spo2_algorithm.cpp:139:6: error: 'pch_hr_valid' was not declared in this scope

 *pch_hr_valid  = 0;

  ^

exit status 1
Error compiling for board WeMos D1 mini Pro.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@nocturnedence
Copy link
Contributor

Hello!
You should edit spo2_algorithm.cpp and uncomment line 70. You can check it here #10.
That worked for me.

@nseidle
Copy link
Member

nseidle commented Mar 4, 2018

Saulin saves the day!

Abir, please give the new code a try. Please re-open if you continue to have problems.

@nseidle nseidle closed this as completed Mar 4, 2018
@AbirKuundu
Copy link
Author

The compilation error is fixed. Thanks a lot. I would try to run the code on my WeMos D1 Mini and let you know if I face any difficulty.

@AbirKuundu
Copy link
Author

AbirKuundu commented Mar 4, 2018

Program Example8_SPO2 compiled successfully and got uploaded to Wemos D1 Mini.
Board I'm using MAX30102. Wire connection is as follows:
WeMos D1 -> MAX30102
5V Vin
G Gnd
D1 SCL
D2 SDA
GND IRD (Without this my IR Led does light up)

When I run the program, I receive the following error every 5 seconds. Seems like the board is resetting. ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld

Can you help? Note: When I run Example8_SPO2 on Arduino Nano, I can get SPO2 value from the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants