oxullo / Arduino-MAX30100

Arduino library for MAX30100, integrated oximeter and heart rate sensor
GNU General Public License v3.0
193 stars 136 forks source link

Arduino Nano Every as a cheaper alternative #71

Open cerebrum2020 opened 4 years ago

cerebrum2020 commented 4 years ago

Troubleshooting checklist

Description of the issue

Hello. We developed a simple device to share a pulse oximeter made by Arduino nano vR3 and MAX30100 board (sure, also with an Oled display by i2c connection). All is good and the read are pretty good.

Switch the arduino board, using a Nano Every, the Max30100 seems not operative. Also there is some issue during compile and upload.

Same connection and same configuration. With i2c scanner we see a correct ouput with nano vR3 and also with Nano Every.

Output from MAX30100_Tester example

With Arduino Nano vR3 the MAX30100_Tester was ok. WIth Arduino Nano Every MAX30100_Tester don't run. Ok during charge (see below), Start but is blocked from the first instance. Seems there in the library there is some "definition or variable" type not correct for the every board.

This is the output from the compile and upload session:


/Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: warning: type 'struct MAX30100' violates the C++ One Definition Rule [-Wodr] class MAX30100 {

/Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: a different type is defined in another translation unit class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:63:52: note: the first difference of corresponding definitions is field 'readoutsBuffer' CircularBuffer<SensorReadout, RINGBUFFER_SIZE> readoutsBuffer; ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:63:52: note: a field of same name but different type is defined in another translation unit CircularBuffer<SensorReadout, RINGBUFFER_SIZE> readoutsBuffer; ^ Arduino/libraries/MAX30100lib/src/CircularBuffer.h:32:41: note: type name 'CircularBuffer<SensorReadout, 16u>' should match type name 'CircularBuffer<SensorReadout, (unsigned char)16>' template<typename T, CB_ST__ S> class CircularBuffer { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:46:10: warning: 'begin' violates the C++ One Definition Rule [-Wodr] bool begin(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:27:6: note: implicit this pointer type mismatch bool MAX30100::begin() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:27:6: note: 'begin' was previously declared here bool MAX30100::begin() ^ /Users/mjtechnology/Documents/Arduino/libraries/MAX30100lib/src/MAX30100.h:60:13: warning: 'getPartId' violates the C++ One Definition Rule [-Wodr] uint8_t getPartId(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:190:9: note: implicit this pointer type mismatch uint8_t MAX30100::getPartId() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:190:9: note: 'getPartId' was previously declared here uint8_t MAX30100::getPartId() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:47:10: warning: 'setMode' violates the C++ One Definition Rule [-Wodr] void setMode(Mode mode); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:45:6: note: implicit this pointer type mismatch void MAX30100::setMode(Mode mode) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:45:6: note: 'setMode' was previously declared here void MAX30100::setMode(Mode mode) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:50:10: warning: 'setLedsCurrent' violates the C++ One Definition Rule [-Wodr] void setLedsCurrent(LEDCurrent irLedCurrent, LEDCurrent redLedCurrent); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:62:6: note: implicit this pointer type mismatch void MAX30100::setLedsCurrent(LEDCurrent irLedCurrent, LEDCurrent redLedCurrent) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:62:6: note: 'setLedsCurrent' was previously declared here void MAX30100::setLedsCurrent(LEDCurrent irLedCurrent, LEDCurrent redLedCurrent) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:58:10: warning: 'shutdown' violates the C++ One Definition Rule [-Wodr] void shutdown(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:174:6: note: implicit this pointer type mismatch void MAX30100::shutdown() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:174:6: note: 'shutdown' was previously declared here void MAX30100::shutdown() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:59:10: warning: 'resume' violates the C++ One Definition Rule [-Wodr] void resume(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:182:6: note: implicit this pointer type mismatch void MAX30100::resume() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:182:6: note: 'resume' was previously declared here void MAX30100::resume() ^ Lo sketch usa 7876 byte (16%) dello spazio disponibile per i programmi. Il massimo è 49152 byte. Le variabili globali usano 552 byte (8%) di memoria dinamica, lasciando altri 5592 byte liberi per le variabili locali. Il massimo è 6144 byte. /Arduino/libraries/MAX30100lib/src/MAX30100.h:55:10: warning: 'startTemperatureSampling' violates the C++ One Definition Rule [-Wodr] void startTemperatureSampling(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:153:6: note: implicit this pointer type mismatch void MAX30100::startTemperatureSampling() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:153:6: note: 'startTemperatureSampling' was previously declared here void MAX30100::startTemperatureSampling() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:56:10: warning: 'isTemperatureReady' violates the C++ One Definition Rule [-Wodr] bool isTemperatureReady(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:161:6: note: implicit this pointer type mismatch bool MAX30100::isTemperatureReady() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:161:6: note: 'isTemperatureReady' was previously declared here bool MAX30100::isTemperatureReady() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:57:11: warning: 'retrieveTemperature' violates the C++ One Definition Rule [-Wodr] float retrieveTemperature(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:166:7: note: implicit this pointer type mismatch float MAX30100::retrieveTemperature() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:166:7: note: 'retrieveTemperature' was previously declared here float MAX30100::retrieveTemperature() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:54:10: warning: 'resetFifo' violates the C++ One Definition Rule [-Wodr] void resetFifo(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:96:6: note: implicit this pointer type mismatch void MAX30100::resetFifo() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:96:6: note: 'resetFifo' was previously declared here void MAX30100::resetFifo() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:52:10: warning: 'update' violates the C++ One Definition Rule [-Wodr] void update(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:77:6: note: implicit this pointer type mismatch void MAX30100::update() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:77:6: note: 'update' was previously declared here void MAX30100::update() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:53:10: warning: 'getRawValues' violates the C++ One Definition Rule [-Wodr] bool getRawValues(uint16_t ir, uint16_t red); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:82:6: note: implicit this pointer type mismatch bool MAX30100::getRawValues(uint16_t ir, uint16_t red) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:82:6: note: 'getRawValues' was previously declared here bool MAX30100::getRawValues(uint16_t ir, uint16_t red) ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:45:5: warning: 'comp_ctor ' violates the C++ One Definition Rule [-Wodr] MAX30100(); ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:23:1: note: implicit this pointer type mismatch MAX30100::MAX30100() ^ /Arduino/libraries/MAX30100lib/src/MAX30100.h:43:7: note: type 'struct MAX30100' itself violates the C++ One Definition Rule class MAX30100 { ^ /Arduino/libraries/MAX30100lib/src/MAX30100.cpp:23:1: note: '__comp_ctor ' was previously declared here MAX30100::MAX30100() ^ avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description


Details of my setup

Many thanks for your help