Welcome to GreenPonik Thermistor 10k’s documentation!

Quality Gate Status Maintainability Rating Lines of Code Duplicated Lines (%) Reliability Rating Security Rating Vulnerabilities Upload Python Package Python package

GreenPonik_Thermistor10k.py Library for Raspberry pi


This is the code for read temperature with thermistor 10k sensor on i2c bus.

Table of Contents

Dev workflow

create python virtual environnement

python3 -m venv venv

activate venv linux

source venv/bin/activate

activate venv windows

venv\Scripts\activate

install dependencies

pip install -r requirements.txt

install dependencies for the documentation

pip install Sphinx sphinx-press-theme m2r2

build documentation

cd docs/ && make clean html

Usage Workflow

Installation

> git clone https://github.com/GreenPonik/GreenPonik_Thermistor10k.git
cd GreenPonik_Thermistor10k
pip3 install -r requirements.txt

or

> pip install greenponik-thermistor10k
from GreenPonik_Thermistor10k.Thermistor10k import Thermistor10k

Methods

"""
Get temperatue in celcius
"""
def read_temp():

Example

import time
from GreenPonik_Thermistor10k.Thermistor10k import Thermistor10k


if __name__ == "__main__":
    try:
        th = Thermistor10k()
        th.debug = True # used for debug
        while True:
            temperature = th.read_temp()
            print("celcius temp %.3f °c" % temperature)
            time.sleep(1)
    except Exception as e:
        print("oops there is an exception {}".format(e))

Credits

Write by Mickael Lehoux, from GreenPonik, 2020

Indices and tables