Skip to main content

Python's itertools for CircuitPython

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

Python’s itertools for CircuitPython

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Usage Example

 import time
 import board
 import busio
 import adafruit_si7021
 from adafruit_itertools.adafruit_itertools import count
 from adafruit_itertools.adafruit_itertools_extras import repeatfunc

 i2c = busio.I2C(board.SCL, board.SDA)
 sensor = adafruit_si7021.SI7021(i2c)

 def read_temperature():
     return sensor.temperature

def now():
    return time.monotonic()

 datapoints = zip(count(1), repeatfunc(now), map(int, repeatfunc(read_temperature)))

 while True:
     print(next(datapoints))
     time.sleep(20.0)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

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

Built Distribution

File details

Details for the file adafruit_circuitpython_itertools-2.1.2.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.1.2.tar.gz
Algorithm Hash digest
SHA256 17f7135423b268844370121d44de2b84f55c6f27d262867ccc5b09d69461012e
MD5 1000c9106f5b0761d7fbc807c9ad00ff
BLAKE2b-256 a437fc3b7563234397ec471150e1871b8f34c776c7b5e1ea05ced53982f7b622

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_itertools-2.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 402e43f9f6ad84c65922846fc4fe027e3aa05b1839a568d28aed4ff7ca6e4573
MD5 260794eecce3f2bec6392fd6e2aa8bf2
BLAKE2b-256 d548f66dfed938feb378db33c13b4d975cc96f4989b4c9647ad299449615604b

See more details on using hashes here.

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