Comment on page
Analog
Python Library for TI ADS1018 ADC.
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.
Reads the analog value.
read(ch)
Parameters
CH ch: Analog input channel. Returns
Int: Analog readout.
Reads the internal IC temperature.
read_temperature(fahrenheit)
Parameters
Bool fahrenheit: True for Fahrenheit output, False for Celcius output. (False is default.) Returns
Float: Internal IC temperature.
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.
Last modified 4yr ago