Comment on page


Python Library for TI ADS1018 ADC.

Python Library

Turta_Analog library is responsible for reading analog inputs from the analog ports.


Add the following statement to the top of your Python code.
from turta_lorahat import Turta_Analog
Then, create an instance of the ADC class.
analog = Turta_Analog.ADC()
Now you're ready to access the library by calling its instance.

Basic Members

Read Analog Input

Reads the analog value.
  • Parameters
    • CH ch: Analog input channel.
  • Returns
    • Int: Analog readout.

Read Temperature

Reads the internal IC temperature.
  • Parameters
    • Bool fahrenheit: True for Fahrenheit output, False for Celcius output. (False is default.)
  • Returns
    • Float: Internal IC temperature.

Advanced Members


Configures the device.
config(ch, pga, mode, dr, ts_mode)
  • Parameters
    • CH ch: Input channel. (Input multiplexer configuration.)
    • PGA pga: Programmable gain amplifier configuration.
    • MODE mode: Device operating mode.
    • DR dr: Data rate.
    • TS_MODE ts_mode: Temperature sensor mode.
  • Returns
    • None


When exiting from the program, the library releases the SPI bus.