1

I'm using a Seeed 4-Channel 16-Bit ADC (ADS1115) for Raspberry Pi with a Stretch installed Raspberry Pi 3 B+ and successfully configured following below guidelines & GitHub.

http://wiki.seeedstudio.com/4-Channel_16-Bit_ADC_for_Raspberry_Pi-ADS1115/

I'm trying to read DC voltage (max 25V) after a voltage divider (ratio 5:1). *Divider is working well.

What I have done :

  • Used AIN0 & GND (channel 1) & connected divider output to that.
  • Changed input voltage (divider input) from 20V to 0V
  • Read all the 4 channel outputs using cmd. used command : ./ads1115.sh

Observations in cmd channel 1:

  • 20V > 2048
  • 18V > 2048
  • 15V > 2048
  • 10V > 2012
  • 5V > 1006
  • 0V > 1

What I expect is the exact value of divider output. (ex : for 20v > 4 , 10V > 2 ) Also I'm trying to use python 3 to read those values with Seeed ADC Hat. What are the libraries to install/decode and how to read those values using python3?

Any suggestions please...

Thank you!

  • Your Seeed link is broken. Are you following this link? wiki.seeedstudio.com/… So you have completed the installation and used the ./ads1115.sh command to read 4 values and found them OK. So now you don't find python ADS1115 library to use? And you have found AdaFruit's ADS1115 python library but they told you they no longer support and recommend you to switch to CircuitPython? Have you ever tried this one? python-exemplary.com/… – tlfong01 May 22 at 8:17
  • @tlfong01 Yes I'm following that Hat. Now I have edited my post with the working link. Thank you! Yes... I found that but 'from ADS1x15 import ADS115 ImportError: No module named 'ADS1x15' then found forums.adafruit.com/viewtopic.php?f=19&t=51399 and tried from Adafruit.ADS1x15 import Adafruit_ADS1x15 ImportError: No module named 'Adafruit' I have downloaded the ZIP file extracted it in the location where I save my python script. Seems like there is something which I couldn't figure out :( Thank you for any suggestion... – Sachz May 22 at 8:36
  • I read Adafruit's forum you referred and found last update 2017. They also reported incompatibilities from upgrading from wheezy to jessie etc. If you are using stretch, then it is likely to meet more incompatibility again. AdaFruit says they no longer support Rpi python. So you have two choices, use Circuit Python, or look else where. I have mentioned another tutorial near the end of my first post. I recommend to try that. – tlfong01 May 22 at 8:42
  • I found the demo program in python-exemplary.com same as AdaFruit. I pasted it in Appendix A of my answer. I ran it and found no errors. Can you also try it and let me know any import errors? – tlfong01 May 22 at 9:10
  • Oh! is that so. Sure I will update you,Let me try ! Thank you !! Yes... I have followed that link(mentioned in the first comment) tutorial and tried with the example and my output was 'from ADS1x15 import ADS115 ImportError: No module named 'ADS1x15' then found forums.adafruit.com/viewtopic.php?f=19&t=51399 and tried from Adafruit.ADS1x15 import Adafruit_ADS1x15 ImportError: No module named 'Adafruit' . I have extracted the ZIP file also in the python file location. Circuit Python sounds new to me. I will google it... – Sachz May 22 at 9:12
1

Question

Rpi3B+ python ADS1115, How?

Short Answer

I am looking at AdaFruit's demo porgram, ...

/ to continue, ...

Long Answer

I am doing some research. Below is the research notes, ...

/ to continue, ...

References

cirtcuitpython

Recommending CircuitPython for Rpi to newbies

CircuitPython overview - Lady Ada

CircuitPython for Rpi - Lady Ada

Installing CircuitPython for Rpi - Lada Ada

Research Notes

Seeed only gives a ads1115.sh script. There is no demo python program. AdaFruit's demo python program for jessie is a bit out of date. I need to check out if I can adapt it for stretch 9.8, ...

/ to continue, ...

Appendices

Appendix A - AdaFruit ADS1115 Python Example Program

Python Exemplary - RPi Tutorial ADC, SPI PROTOCOL

Experiment 2: Using the ADS1015/ADS1115

The ADS1015 is a 12-bit ADC with 4 channels, whereas the ADS1115 is its 16-bit counterpart (consult data sheets ADS1015 or ADS1115).

Both have the same pin layout and are only available with a SMT package. To avoid soldering SMT, module boards can be purchased. They are available from different sources, especially from vendors of Arduino components. You also find cheap offers of the ADS1115 module fabricated in China on Ebay (if you are patient enough to wait for the delivery).

The ADS1x15 series has an I2C-bus interface with 4 user-selectable addresses depending on how the ADDR pin is connected (see table). As you see, if ADDR is wired to GND, the address is 0x48.

The ADS1x15 may be configured for 4 single-ended inputs or 2 differential inputs. In single-ended mode the maximum voltage range is 0 to VCC (never apply a negative voltage or a voltage higher than VCC). In differential mode, the maximum differential voltage range is -VCC to VCC. The actual range depends on the gain set in the programmable gain amplifier (PGA).

For the ADS1015 the ouput data range is 0..2047 (single ended) and -2048..2047 (differential). For the ADS1115 the output data range is 0..32767 (single ended) and -32768..32767 (differential).

Aim:

Digitize a voltage in the range 0..3.3V or 0..5V and display the result in the console and (if available) on an attached display.

If you don't use pull-up resistors to the VDD rail, you can power the IC with 3.3V or 5V, but be aware that the pull-up resistors are normally part of the module.

Caution: If you want to power the board from the 5V supply, you must remove the two pull-up resistors R1 and R2 shown by the red arrows. If you power it with 3.3V (or you use a voltage-level converter), no modification is needed.

If you use the ALERT pin and a 5V supply, the pull-up resistor R4 must also be removed. Board schematic (by most manufacturers, with no guarantee!):

Program

Compared to other I2C-devices the ADS1x15 chip is a bit more complicated to be configured by software. Therefore we recommend to use a well-designed Python class library ADS1x15 written by Tony DiCola for Adafruit Industries and generously put to public domain.

Download the module file ADS1x15.py (and some examples) from here and put it in the same folder where your program resides. Consult the Python documentation and the comments in the source code for more information.

By encapsulating the details of the code to communicate with the device, the program becomes extremely simple.

# Copyright (c) 2016 Adafruit Industries
# Author: Tony DiCola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

# Slightly modified by Aegidius Pluess (www.aplu.ch), to remove references to other modules

import time
import smbus

# Register and other configuration values:
ADS1x15_DEFAULT_ADDRESS        = 0x48
ADS1x15_POINTER_CONVERSION     = 0x00
ADS1x15_POINTER_CONFIG         = 0x01
ADS1x15_POINTER_LOW_THRESHOLD  = 0x02
ADS1x15_POINTER_HIGH_THRESHOLD = 0x03
ADS1x15_CONFIG_OS_SINGLE       = 0x8000
ADS1x15_CONFIG_MUX_OFFSET      = 12
# Maping of gain values to config register values.
ADS1x15_CONFIG_GAIN = {
    2/3: 0x0000,
    1:   0x0200,
    2:   0x0400,
    4:   0x0600,
    8:   0x0800,
    16:  0x0A00
}
ADS1x15_CONFIG_MODE_CONTINUOUS  = 0x0000
ADS1x15_CONFIG_MODE_SINGLE      = 0x0100
# Mapping of data/sample rate to config register values for ADS1015 (faster).
ADS1015_CONFIG_DR = {
    128:   0x0000,
    250:   0x0020,
    490:   0x0040,
    920:   0x0060,
    1600:  0x0080,
    2400:  0x00A0,
    3300:  0x00C0
}
# Mapping of data/sample rate to config register values for ADS1115 (slower).
ADS1115_CONFIG_DR = {
    8:    0x0000,
    16:   0x0020,
    32:   0x0040,
    64:   0x0060,
    128:  0x0080,
    250:  0x00A0,
    475:  0x00C0,
    860:  0x00E0
}
ADS1x15_CONFIG_COMP_WINDOW      = 0x0010
ADS1x15_CONFIG_COMP_ACTIVE_HIGH = 0x0008
ADS1x15_CONFIG_COMP_LATCHING    = 0x0004
ADS1x15_CONFIG_COMP_QUE = {
    1: 0x0000,
    2: 0x0001,
    4: 0x0002
}
ADS1x15_CONFIG_COMP_QUE_DISABLE = 0x0003


class ADS1x15(object):
    """Base functionality for ADS1x15 analog to digital converters."""

    def __init__(self, address = ADS1x15_DEFAULT_ADDRESS, busnum = 1):
        self._address = address
        self._bus = smbus.SMBus(busnum)

    def _data_rate_default(self):
        """Retrieve the default data rate for this ADC (in samples per second).
        Should be implemented by subclasses.
        """
        raise NotImplementedError('Subclasses must implement _data_rate_default!')

    def _data_rate_config(self, data_rate):
        """Subclasses should override this function and return a 16-bit value
        that can be OR'ed with the config register to set the specified
        data rate.  If a value of None is specified then a default data_rate
        setting should be returned.  If an invalid or unsupported data_rate is
        provided then an exception should be thrown.
        """
        raise NotImplementedError('Subclass must implement _data_rate_config function!')

    def _conversion_value(self, low, high):
        """Subclasses should override this function that takes the low and high
        byte of a conversion result and returns a signed integer value.
        """
        raise NotImplementedError('Subclass must implement _conversion_value function!')

    def _read(self, mux, gain, data_rate, mode):
        """Perform an ADC read with the provided mux, gain, data_rate, and mode
        values.  Returns the signed integer result of the read.
        """
        config = ADS1x15_CONFIG_OS_SINGLE  # Go out of power-down mode for conversion.
        # Specify mux value.
        config |= (mux & 0x07) << ADS1x15_CONFIG_MUX_OFFSET
        # Validate the passed in gain and then set it in the config.
        if gain not in ADS1x15_CONFIG_GAIN:
            raise ValueError('Gain must be one of: 2/3, 1, 2, 4, 8, 16')
        config |= ADS1x15_CONFIG_GAIN[gain]
        # Set the mode (continuous or single shot).
        config |= mode
        # Get the default data rate if none is specified (default differs between
        # ADS1015 and ADS1115).
        if data_rate is None:
            data_rate = self._data_rate_default()
        # Set the data rate (this is controlled by the subclass as it differs
        # between ADS1015 and ADS1115).
        config |= self._data_rate_config(data_rate)
        config |= ADS1x15_CONFIG_COMP_QUE_DISABLE  # Disble comparator mode.
        # Send the config value to start the ADC conversion.
        # Explicitly break the 16-bit value down to a big endian pair of bytes.
        self.writeList(ADS1x15_POINTER_CONFIG, [(config >> 8) & 0xFF, config & 0xFF])
        # Wait for the ADC sample to finish based on the sample rate plus a
        # small offset to be sure (0.1 millisecond).
        time.sleep(1.0/data_rate+0.0001)
        # Retrieve the result.
        result = self.readList(ADS1x15_POINTER_CONVERSION, 2)
        return self._conversion_value(result[1], result[0])

    def _read_comparator(self, mux, gain, data_rate, mode, high_threshold,
                         low_threshold, active_low, traditional, latching,
                         num_readings):
        """Perform an ADC read with the provided mux, gain, data_rate, and mode
        values and with the comparator enabled as specified.  Returns the signed
        integer result of the read.
        """
        assert num_readings == 1 or num_readings == 2 or num_readings == 4, 'Num readings must be 1, 2, or 4!'
        # Set high and low threshold register values.
        self.writeList(ADS1x15_POINTER_HIGH_THRESHOLD, [(high_threshold >> 8) & 0xFF, high_threshold & 0xFF])
        self.writeList(ADS1x15_POINTER_LOW_THRESHOLD, [(low_threshold >> 8) & 0xFF, low_threshold & 0xFF])
        # Now build up the appropriate config register value.
        config = ADS1x15_CONFIG_OS_SINGLE  # Go out of power-down mode for conversion.
        # Specify mux value.
        config |= (mux & 0x07) << ADS1x15_CONFIG_MUX_OFFSET
        # Validate the passed in gain and then set it in the config.
        if gain not in ADS1x15_CONFIG_GAIN:
            raise ValueError('Gain must be one of: 2/3, 1, 2, 4, 8, 16')
        config |= ADS1x15_CONFIG_GAIN[gain]
        # Set the mode (continuous or single shot).
        config |= mode
        # Get the default data rate if none is specified (default differs between
        # ADS1015 and ADS1115).
        if data_rate is None:
            data_rate = self._data_rate_default()
        # Set the data rate (this is controlled by the subclass as it differs
        # between ADS1015 and ADS1115).
        config |= self._data_rate_config(data_rate)
        # Enable window mode if required.
        if not traditional:
            config |= ADS1x15_CONFIG_COMP_WINDOW
        # Enable active high mode if required.
        if not active_low:
            config |= ADS1x15_CONFIG_COMP_ACTIVE_HIGH
        # Enable latching mode if required.
        if latching:
            config |= ADS1x15_CONFIG_COMP_LATCHING
        # Set number of comparator hits before alerting.
        config |= ADS1x15_CONFIG_COMP_QUE[num_readings]
        # Send the config value to start the ADC conversion.
        # Explicitly break the 16-bit value down to a big endian pair of bytes.
        self.writeList(ADS1x15_POINTER_CONFIG, [(config >> 8) & 0xFF, config & 0xFF])
        # Wait for the ADC sample to finish based on the sample rate plus a
        # small offset to be sure (0.1 millisecond).
        time.sleep(1.0/data_rate+0.0001)
        # Retrieve the result.
        result = self.readList(ADS1x15_POINTER_CONVERSION, 2)
        return self._conversion_value(result[1], result[0])

    def read_adc(self, channel, gain=1, data_rate=None):
        """Read a single ADC channel and return the ADC value as a signed integer
        result.  Channel must be a value within 0-3.
        You can also pass in an optional data_rate parameter that controls
        the ADC conversion time (in samples/second). Each chip has a different
        set of allowed data rate values, see datasheet Table 9 config register
        DR bit values.
        ADS1015: 128, 250, 490, 920, 1600(default), 2400, 3300
        ADS1115: 8, 16, 32, 64, 128 (default), 250, 475, 860
        Each returned value will be a 12 or 16 bit signed integer value depending on the
        ADC (ADS1015 = 12-bit, ADS1115 = 16-bit).
        Gain of 1 for reading voltages from 0 to 4.09V.
        Or pick a different gain to change the range of voltages that are read:
        - 2/3 = +/-6.144V
        -   1 = +/-4.096V
        -   2 = +/-2.048V
        -   4 = +/-1.024V
        -   8 = +/-0.512V
        -  16 = +/-0.256V
        See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.
        """
        assert 0 <= channel <= 3, 'Channel must be a value within 0-3!'
        # Perform a single shot read and set the mux value to the channel plus
        # the highest bit (bit 3) set.
        return self._read(channel + 0x04, gain, data_rate, ADS1x15_CONFIG_MODE_SINGLE)

    def read_adc_difference(self, differential, gain=1, data_rate=None):
        """Read the difference between two ADC channels and return the ADC value
        as a signed integer result.  Differential must be one of:
          - 0 = Channel 0 minus channel 1
          - 1 = Channel 0 minus channel 3
          - 2 = Channel 1 minus channel 3
          - 3 = Channel 2 minus channel 3
        """
        assert 0 <= differential <= 3, 'Differential must be a value within 0-3!'
        # Perform a single shot read using the provided differential value
        # as the mux value (which will enable differential mode).
        return self._read(differential, gain, data_rate, ADS1x15_CONFIG_MODE_SINGLE)

    def start_adc(self, channel, gain=1, data_rate=None):
        """Start continuous ADC conversions on the specified channel (0-3). Will
        return an initial conversion result, then call the get_last_result()
        function to read the most recent conversion result. Call stop_adc() to
        stop conversions.
        You can also pass in an optional data_rate parameter that controls
        the ADC conversion time (in samples/second). Each chip has a different
        set of allowed data rate values, see datasheet Table 9 config register
        DR bit values.
        ADS1015: 128, 250, 490, 920, 1600(default), 2400, 3300
        ADS1115: 8, 16, 32, 64, 128 (default), 250, 475, 860
        Each returned value will be a 12 or 16 bit signed integer value depending on the
        ADC (ADS1015 = 12-bit, ADS1115 = 16-bit).
        Gain of 1 for reading voltages from 0 to 4.09V.
        Or pick a different gain to change the range of voltages that are read:
        - 2/3 = +/-6.144V
        -   1 = +/-4.096V
        -   2 = +/-2.048V
        -   4 = +/-1.024V
        -   8 = +/-0.512V
        -  16 = +/-0.256V
        See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.
        """
        assert 0 <= channel <= 3, 'Channel must be a value within 0-3!'
        # Start continuous reads and set the mux value to the channel plus
        # the highest bit (bit 3) set.
        return self._read(channel + 0x04, gain, data_rate, ADS1x15_CONFIG_MODE_CONTINUOUS)

    def start_adc_difference(self, differential, gain=1, data_rate=None):
        """Start continuous ADC conversions between two ADC channels. Differential
        must be one of:
          - 0 = Channel 0 minus channel 1
          - 1 = Channel 0 minus channel 3
          - 2 = Channel 1 minus channel 3
          - 3 = Channel 2 minus channel 3
        Will return an initial conversion result, then call the get_last_result()
        function continuously to read the most recent conversion result.  Call
        stop_adc() to stop conversions.
        """
        assert 0 <= differential <= 3, 'Differential must be a value within 0-3!'
        # Perform a single shot read using the provided differential value
        # as the mux value (which will enable differential mode).
        return self._read(differential, gain, data_rate, ADS1x15_CONFIG_MODE_CONTINUOUS)

    def start_adc_comparator(self, channel, high_threshold, low_threshold,
                             gain=1, data_rate=None, active_low=True,
                             traditional=True, latching=False, num_readings=1):
        """Start continuous ADC conversions on the specified channel (0-3) with
        the comparator enabled.  When enabled, the comparator checks if
        the ADC value is within the high_threshold & low_threshold value (both
        should be signed 16-bit integers) and trigger the ALERT pin.  The
        behavior can be controlled by the following parameters:
          - active_low: Boolean that indicates if ALERT is pulled low or high
                        when active/triggered.  Default is true, active low.
          - traditional: Boolean that indicates if the comparator is in traditional
                         mode where it fires when the value is within the threshold,
                         or in window mode where it fires when the value is _outside_
                         the threshold range.  Default is true, traditional mode.
          - latching: Boolean that indicates if the alert should be held until
                      get_last_result() is called to read the value and clear
                      the alert.  Default is false, non-latching.
          - num_readings: The number of readings that match the comparator before
                          triggering the alert.  Can be 1, 2, or 4.  Default is 1.
        Will return an initial conversion result, then call the get_last_result()
        function continuously to read the most recent conversion result.  Call
        stop_adc() to stop conversions.
        """
        assert 0 <= channel <= 3, 'Channel must be a value within 0-3!'
        # Start continuous reads with comparator and set the mux value to the
        # channel plus the highest bit (bit 3) set.
        return self._read_comparator(channel + 0x04, gain, data_rate,
                                     ADS1x15_CONFIG_MODE_CONTINUOUS,
                                     high_threshold, low_threshold, active_low,
                                     traditional, latching, num_readings)

    def start_adc_difference_comparator(self, differential, high_threshold, low_threshold,
                                        gain=1, data_rate=None, active_low=True,
                                        traditional=True, latching=False, num_readings=1):
        """Start continuous ADC conversions between two channels with
        the comparator enabled.  See start_adc_difference for valid differential
        parameter values and their meaning.  When enabled the comparator to will
        check if the ADC value is within the high_threshold & low_threshold value
        (both should be signed 16-bit integers) and trigger the ALERT pin.  The
        behavior can be controlled by the following parameters:
          - active_low: Boolean that indicates if ALERT is pulled low or high
                        when active/triggered.  Default is true, active low.
          - traditional: Boolean that indicates if the comparator is in traditional
                         mode where it fires when the value is within the threshold,
                         or in window mode where it fires when the value is _outside_
                         the threshold range.  Default is true, traditional mode.
          - latching: Boolean that indicates if the alert should be held until
                      get_last_result() is called to read the value and clear
                      the alert.  Default is false, non-latching.
          - num_readings: The number of readings that match the comparator before
                          triggering the alert.  Can be 1, 2, or 4.  Default is 1.
        Will return an initial conversion result, then call the get_last_result()
        function continuously to read the most recent conversion result.  Call
        stop_adc() to stop conversions.
        """
        assert 0 <= differential <= 3, 'Differential must be a value within 0-3!'
        # Start continuous reads with comparator and set the mux value to the
        # channel plus the highest bit (bit 3) set.
        return self._read_comparator(differential, gain, data_rate,
                                     ADS1x15_CONFIG_MODE_CONTINUOUS,
                                     high_threshold, low_threshold, active_low,
                                     traditional, latching, num_readings)

    def stop_adc(self):
        """Stop all continuous ADC conversions (either normal or difference mode).
        """
        # Set the config register to its default value of 0x8583 to stop
        # continuous conversions.
        config = 0x8583
        self.writeList(ADS1x15_POINTER_CONFIG, [(config >> 8) & 0xFF, config & 0xFF])

    def get_last_result(self):
        """Read the last conversion result when in continuous conversion mode.
        Will return a signed integer value.
        """
        # Retrieve the conversion register value, convert to a signed int, and
        # return it.
        result = self.readList(ADS1x15_POINTER_CONVERSION, 2)
        return self._conversion_value(result[1], result[0])

    def readList(self, register, length):
        """Read a length number of bytes from the specified register.  Results
        will be returned as a bytearray."""
        results = self._bus.read_i2c_block_data(self._address, register, length)
        return results


    def writeList(self, register, data):
        """Write bytes to the specified register."""
        self._bus.write_i2c_block_data(self._address, register, data)


class ADS1115(ADS1x15):
    """ADS1115 16-bit analog to digital converter instance."""

    def __init__(self, *args, **kwargs):
        super(ADS1115, self).__init__(*args, **kwargs)

    def _data_rate_default(self):
        # Default from datasheet page 16, config register DR bit default.
        return 128

    def _data_rate_config(self, data_rate):
        if data_rate not in ADS1115_CONFIG_DR:
            raise ValueError('Data rate must be one of: 8, 16, 32, 64, 128, 250, 475, 860')
        return ADS1115_CONFIG_DR[data_rate]

    def _conversion_value(self, low, high):
        # Convert to 16-bit signed value.
        value = ((high & 0xFF) << 8) | (low & 0xFF)
        # Check for sign bit and turn into a negative value if set.
        if value & 0x8000 != 0:
            value -= 1 << 16
        return value

class ADS1015(ADS1x15):
    """ADS1015 12-bit analog to digital converter instance."""

    def __init__(self, *args, **kwargs):
        super(ADS1015, self).__init__(*args, **kwargs)

    def _data_rate_default(self):
        # Default from datasheet page 19, config register DR bit default.
        return 1600

    def _data_rate_config(self, data_rate):
        if data_rate not in ADS1015_CONFIG_DR:
            raise ValueError('Data rate must be one of: 128, 250, 490, 920, 1600, 2400, 3300')
        return ADS1015_CONFIG_DR[data_rate]

    def _conversion_value(self, low, high):
        # Convert to 12-bit signed value.
        value = ((high & 0xFF) << 4) | ((low & 0xFF) >> 4)
        # Check for sign bit and turn into a negative value if set.
        if value & 0x800 != 0:
            value -= 1 << 12
        return value
  • "Download the module file ADS1x15.py (and some examples) from **here**". Seems like the link is missing... – Sachz May 22 at 9:26
  • Do you mean the download link in the python-exemplary.com site? I clicked the link and downloaded a zip file, containing many programs, including the ads1115.py program. So I just extracted that program and pasted in Appendix A. If you still have problems downloading, you can try Appendix A, and download later. – tlfong01 May 22 at 11:53
  • Got it thank you! replied in the above comment of mine :) – Sachz May 23 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.