Closed Mohit2183 closed 4 years ago
Hi @Mohit2183 I see references to arduino-sps and embedded-sps but you can't mix the drivers. Arduino compiles everything it finds in the same directory, which could be what causes your duplicate main function error since the example usage C file from embedded-sps is in there. The other errors come from an unmodified embedded-sps driver framework, for which you must implement the hardware abstraction. For Arduino, try only using https://github.com/Sensirion/arduino-sps - it already comes with the HAL implementation for some Arduinos. The latest release is 0.0.6
Unfortunately we don't have the resources to assist you further. If you have strong reasons to believe that there is a bug in the drivers please file another issue, otherwise we kindly ask you to refer to other sources like Arduino related forums for programming questions.
Thanks for your understanding and good luck
My system is generating multiple errors, I am confused can any one guide me why. i.e. library has been installed. Below is description of error codes being generated, Pls guide why it is happening:
Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1\sps30.c: In function 'sps30_get_fan_auto_cleaning_interval_days':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1\sps30.c:209:50: warning: integer overflow in expression [-Woverflow]
libraries\sps30-i2c-3.0.1\sps30_example_usage.c.o (symbol from plugin): In function `main':
(.text+0x0): multiple definition of `main'
sketch\sps30.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `sensirion_i2c_read_words_as_bytes':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1/sensirion_common.c:94: undefined reference to `sensirion_i2c_read'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `main':
E:\ALPHASENSE\sps30\arduino-sps-0.0.2 (1)\arduino-sps-0.0.2\examples\sps30/sps30.ino:30: undefined reference to `sensirion_i2c_init'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `sensirion_i2c_delayed_read_cmd':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1/sensirion_common.c:153: undefined reference to `sensirion_i2c_write'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `sensirion_i2c_write_cmd_with_args':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1/sensirion_common.c:143: undefined reference to `sensirion_i2c_write'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `sps30_start_measurement':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1/sps30.c:103: undefined reference to `sensirion_sleep_usec'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `main':
E:\ALPHASENSE\sps30\arduino-sps-0.0.2 (1)\arduino-sps-0.0.2\examples\sps30/sps30.ino:64: undefined reference to `sensirion_sleep_usec'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `sensirion_i2c_delayed_read_cmd':
C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1/sensirion_common.c:153: undefined reference to `sensirion_i2c_write'
C:\Users\Airshed\AppData\Local\Temp\ccClGeOx.ltrans0.ltrans.o: In function `main':
E:\ALPHASENSE\sps30\arduino-sps-0.0.2 (1)\arduino-sps-0.0.2\examples\sps30/sps30.ino:44: undefined reference to `sensirion_sleep_usec'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "sps30.h" Used: C:\Users\Airshed\Documents\Arduino\libraries\sps30-i2c-3.0.1 Not used: C:\Users\Airshed\Documents\Arduino\libraries\arduino-sps-0.0.2 Not used: C:\Users\Airshed\Documents\Arduino\libraries\sensirion-sps exit status 1 Error compiling for board Arduino/Genuino Uno.
This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.