Skip to main content

Python's itertools for CircuitPython

Project description

Introduction

Documentation Status Discord Build Status

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

adafruit-circuitpython-itertools-2.0.0.tar.gz (35.1 kB view details)

Uploaded Source

File details

Details for the file adafruit-circuitpython-itertools-2.0.0.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-itertools-2.0.0.tar.gz
Algorithm Hash digest
SHA256 836435ad9c9bfb65693818f63966717ff2a65d812370bbfdfdaec287f1f61eae
MD5 cb5c5837fd2c85b4723fcaf6d9319653
BLAKE2b-256 3d45d7cabbe7c83b578a5300abc85ff7da079ab7246668f2c5909df67be08bb4

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