Skip to main content

Driver for the Anyleaf pH sensor

Project description

Anyleaf

For use with the Anyleaf pH sensor

Example use:

import time

import board
import busio
from anyleaf import PhSensor, CalPt


def main():
    i2c = busio.I2C(board.SCL, board.SDA)
    ph_sensor = PhSensor(i2c)

    # Can use 2 or 3-pt calibration.
    ph_sensor.calibrate(
        CalPt(0., 7., 25.), CalPt(-0.18, 4., 25.), CalPt(0.18, 4., 25.)
    )

    while True:
        pH = ph_sensor.read()
        print(f"pH: {pH}")
        time.sleep(.5)


if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anyleaf-0.1.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

anyleaf-0.1.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page