Trees | Indices | Help |
---|
|
object --+ | ADS1x15
Base functionality for ADS1x15 analog to digital converters.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Retrieve the default data rate for this ADC (in samples per second). Should be implemented by subclasses. |
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. |
Perform an ADC read with the provided mux, gain, data_rate, and mode values. Returns the signed integer result of the read. |
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. |
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. |
Read the difference between two ADC channels and return the ADC value as a signed integer result. Differential must be one of:
|
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. |
Start continuous ADC conversions between two ADC channels. Differential must be one of:
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. |
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:
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. |
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:
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. |
Read the last conversion result when in continuous conversion mode. Will return a signed integer value. |
Read a length number of bytes from the specified register. Results will be returned as a bytearray. |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Apr 16 12:46:33 2017 | http://epydoc.sourceforge.net |