Hello,
I'm using ADS1115 with Arduino Mega 250 board everything was going good till yesterday. From morning i'm getting this error when i am trying to compile. can anyone please help me in this ? i'm not getting proper solution for below error.
'''
c:\users\abc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\util\delay.h: In function 'Adafruit_ADS1115::readADC_SingleEnded(unsigned char) [clone .part.1] [clone .constprop]':
c:\users\abc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\util\delay.h:276:28: error: __builtin_avr_delay_cycles expects a compile time integer constant
__builtin_avr_delay_cycles(__ticks_dc);
^
lto-wrapper.exe: fatal error: C:\Users\abc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/users/abc/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Using library Adafruit_ADS1115-master in folder: C:\Users\abc\Documents\Arduino\libraries\Adafruit_ADS1115-master (legacy)
Using library Wire at version 1.0 in folder: C:\Users\abc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Using library Arduino-LiquidCrystal-I2C-library-master in folder: C:\Users\abc\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master (legacy)
Using library MCP_DAC at version 0.1.8 in folder: C:\Users\abc\Documents\Arduino\libraries\MCP_DAC
Using library SPI at version 1.0 in folder: C:\Users\abc\AppData\Local\ArduiPreformatted textno15\packages\arduino\hardware\avr\1.8.6\libraries\SPI
exit status 1 Error compiling for board Arduino Mega or Mega 2560.
'''
@stryxter Hello , yes i have tried all of above points that you have mentioned. i have attched my sketch kindly refer that might help us to resolve issue.
As you told i had done same changes in ADS1115.cpp and tried to compile code but still same errors i got .please find attachment with this post.
I got below errors while compile.
"C:\\Users\\abc\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega2560 -o "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972/sketch_jan07a.ino.elf" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\sketch\\sketch_jan07a.ino.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\Adafruit_ADS1115-master\\Adafruit_ADS1115.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\Wire\\Wire.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\Wire\\utility\\twi.c.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\MCP_DAC\\MCP_DAC.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972\\libraries\\Arduino-LiquidCrystal-I2C-library-master\\LiquidCrystal_I2C.cpp.o" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972/core\\core.a" "-LC:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_76972" -lm
c:\users\abc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\util\delay.h: In function 'Adafruit_ADS1115::readADC_SingleEnded(unsigned char) [clone .part.1] [clone .constprop]':
c:\users\abc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\util\delay.h:276:28: error: __builtin_avr_delay_cycles expects a compile time integer constant
__builtin_avr_delay_cycles(__ticks_dc);
^
lto-wrapper.exe: fatal error: C:\Users\abc\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/users/abc/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Using library Adafruit_ADS1115-master in folder: C:\Users\abc\Documents\Arduino\libraries\Adafruit_ADS1115-master (legacy)
Using library Wire at version 1.0 in folder: C:\Users\abc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Using library MCP_DAC at version 0.1.8 in folder: C:\Users\abc\Documents\Arduino\libraries\MCP_DAC
Using library SPI at version 1.0 in folder: C:\Users\abc\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI
Using library Arduino-LiquidCrystal-I2C-library-master in folder: C:\Users\abc\Documents\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master (legacy)
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
please, please never ever again post pictures of text... Not only they are not readable nor usable directly for copy&paste but they use up lots of storage and internet bandwidth which contributes to polluting the planet.
➜ do your part and do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).