Ok my Arduino micro is giving me a trying time, and I hope someone can assist.
I have the ADS1115 module hooked up to the I2C port (2&3) and using Nick Gammons I2C_scanner works fine. I get an address returned via USB serial 0x48 i think it was.
When I try to move on to another example, the Adafruit ADS1X15 single ended for example, i get nada, nothing, zero out of the serial port (usb - COM12).
I change no wiring between code changes. (+5, GND, SDA, SCL all left alone)
If you look at void setup, serial prints happen before ads.begin, however ads.begin needs to have the correct address for the AD module, then the serial prints work.
I thought things happened line-by-line in the arduino universe...
No, you've misread the situation.
The prints simply cause characters to be written to a buffer, to be printed at a later time.
The mechanism that prints them is dependent upon interrupts, which if disabled will prevent prints.
If whatever is causing your I2C to fail is also preventing interrupts then you won't see your prints.
A delay after the prints, or a flush should show how this works.
If you look at your setup()
In sequence.
You set the baud at 9600
Print text line of "Hello!"
Print a second text line
Print another text line with a bunch of numbers as text.
Then sent out a setting that goes nowhere
Then...now that you figured it out.. set the I2C address .
The I2C address that you expected the gain setting to go.
Move the address settings to above the gain.
A simple suggestion.
Instead of hello print your file name.
No, I think the suggestion is that setting the gain before the "begin" was the problem, assuming that gain setting requires communication with a device, and isn't simply an internal driver operation.