package
stringlengths 1
122
| pacakge-description
stringlengths 0
1.3M
|
---|---|
adafruit-circuitpython-mlx90640 | IntroductionDriver for the MLX90640 thermal cameraDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mlx90640To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mlx90640To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mlx90640Usage Exampleimporttimeimportboardimportbusioimportadafruit_mlx90640i2c=busio.I2C(board.SCL,board.SDA,frequency=800000)mlx=adafruit_mlx90640.MLX90640(i2c)print("MLX addr detected on I2C",[hex(i)foriinmlx.serial_number])# if using higher refresh rates yields a 'too many retries' exception,# try decreasing this value to work with certain pi/camera combinationsmlx.refresh_rate=adafruit_mlx90640.RefreshRate.REFRESH_2_HZframe=[0]*768whileTrue:try:mlx.getFrame(frame)exceptValueError:# these happen, no biggie - retrycontinueforhinrange(24):forwinrange(32):t=frame[h*32+w]print("%0.1f, "%t,end="")print()print()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mlx90939 | IntroductionAdafruit CircuitPython driver for the MLX90393 3-axis magnetometer.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mlx90939To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mlx90939To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-mlx90939Usage Exampleimporttimeimportbusioimportboardimportadafruit_mlx90393I2C_BUS=busio.I2C(board.SCL,board.SDA)SENSOR=adafruit_mlx90393.MLX90393(I2C_BUS,gain=adafruit_mlx90393.GAIN_1X)whileTrue:MX,MY,MZ=SENSOR.read_data(delay=1.0,raw=False)print("[{}]".format(time.monotonic()))print("X:{}uT".format(MX))print("Y:{}uT".format(MY))print("Z:{}uT".format(MZ))# Display the status field if an error occured, etc.ifSENSOR.last_status>adafruit_mlx90393.STATUS_OK:SENSOR.display_status()ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.envsource.env/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.env/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixadafruit_circuitpython_mlx90393--library_location.Sphinx documentationSphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):python3-mvenv.envsource.env/bin/activatepipinstallSphinxsphinx-rtd-themeNow, once you have the virtual environment activated:cddocssphinx-build-E-W-bhtml._build/htmlThis will output the documentation todocs/_build/html. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass. |
adafruit-circuitpython-mma8451 | IntroductionCircuitPython module for the MMA8451 3 axis accelerometer.Note:Older versions of the Raspberry Pi firmware do not have I2C clock stretching support so they don’t work well with the MMA. Please ensure your firmware is updated to the latest version before continuing and slow down the I2C as explained here:https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/i2c-clock-stretchingDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mma8451To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mma8451To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mma8451Usage ExampleSee examples/simpletest.py for a demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mmc56x3 | IntroductionMagnetometer sensor libraryDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-mmc56x3To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mmc56x3To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mmc56x3Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstallmmc56x3Or the following command to update an existing version:circupupdateUsage ExampleExamples of using this library can be found in theexamples/folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-monsterm4sk | IntroductionHelper library for the Monster M4sk device. Allows usage of screens and other built-in hardware.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterSeesawLIS3DHST7789Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPINoteThis library will not be available on PyPI. Install documentation is included
as a standard element.Usage Exampleimportboardimportdisplayiofromadafruit_display_shapes.circleimportCircleimportadafruit_monsterm4skSCREEN_SIZE=240i2c_bus=board.I2C()mask=adafruit_monsterm4sk.MonsterM4sk(i2c=i2c_bus)left_group=displayio.Group()mask.left_display.root_group=left_groupright_group=displayio.Group()mask.right_display.root_group=right_groupright_circle=Circle(SCREEN_SIZE//2,SCREEN_SIZE//2,40,fill=0x0000FF)right_group.append(right_circle)left_circle=Circle(SCREEN_SIZE//2,SCREEN_SIZE//2,40,fill=0x00AA66)left_group.append(left_circle)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-motor | IntroductionThis helper library provides higher level objects to control motors and servos based on one or more
PWM outputs.The PWM outputs can be any object that have a 16-bitduty_cycleattribute. Its assumed that the
frequency has already been configured appropriately. (Typically 50hz for servos and 1600hz for
motors.)DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-motorTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-motorTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-motorDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-motorkit | IntroductionCircuitPython helper library for the DC & Stepper Motor FeatherWing, Shield and Pi Hat kits.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPCA9685MotorPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-motorkitTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-motorkitTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-motorkitUsage ExampleDC motor example:importtimefromadafruit_motorkitimportMotorKitkit=MotorKit()kit.motor1.throttle=1.0time.sleep(0.5)kit.motor1.throttle=0Stepper motor example:importtimefromadafruit_motorkitimportMotorKitkit=MotorKit()foriinrange(100):kit.stepper1.onestep()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mpl115a2 | IntroductionCircuitPython driver for MPL115A2 I2C Barometric Pressure/Temperature Sensor.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mpl115a2To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mpl115a2To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mpl115a2Usage ExampleSee usage examples in the examples folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mpl3115a2 | IntroductionCircuitPython module for the MPL3115A2 barometric pressure & temperature sensor.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mpl3115a2To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mpl3115a2To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mpl3115a2Usage ExampleSee examples/simpletest.py for a demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mpr121 | IntroductionAdafruit CircuitPython module for the MPR121 capacitive touch breakout board.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mpr121To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mpr121To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mpr121Usage ExampleSee usage in the examples/mpr121_simpletest.py file.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mprls | IntroductionCircuitPython library to support Honeywell MPRLS digital pressure sensors.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mprlsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mprlsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mprlsUsage Exampleimporttimeimportboardimportadafruit_mprlsi2c=board.I2C()# Simplest use, connect to default over I2Cmpr=adafruit_mprls.MPRLS(i2c,psi_min=0,psi_max=25)whileTrue:print((mpr.pressure,))time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-mpu6050 | IntroductionCircuitPython helper library for the MPU6050 6-DoF Accelerometer and GyroscopeDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-mpu6050To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mpu6050To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mpu6050Usage Exampleimporttimeimportboardimportadafruit_mpu6050i2c=board.I2C()# uses board.SCL and board.SDAmpu=adafruit_mpu6050.MPU6050(i2c)whileTrue:print("Acceleration: X:%.2f, Y:%.2f, Z:%.2fm/s^2"%(mpu.acceleration))print("Gyro X:%.2f, Y:%.2f, Z:%.2fdegrees/s"%(mpu.gyro))print("Temperature:%.2fC"%mpu.temperature)print("")time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ms8607 | IntroductionCircuitPython driver for the MS8607 PTH sensorDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ms8607To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ms8607To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ms8607Usage Examplefromtimeimportsleepimportboardfromadafruit_ms8607importMS8607i2c=board.I2C()sensor=MS8607(i2c)whileTrue:print("Pressure:%.2fhPa"%sensor.pressure)print("Temperature:%.2fC"%sensor.temperature)print("Humidity:%.2f%%rH"%sensor.relative_humidity)sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-msa301 | IntroductionCircuitPython library for the MSA301/MSA311 AccelerometersDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-msa301To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-msa301To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-msa301Usage ExampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-neokey | IntroductionThis is a library for using the Adafruit NeoKey boards with circuitpython.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterAdafruit SeesawPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-neokeyTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-neokeyTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-neokeyUsage Examplesee examples/neokey1x4_simpletest.py for usage exampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-neopixel | Adafruit CircuitPython NeoPixelHigher level NeoPixel driver that presents the strip as a sequence. This is a
supercharged version of the original MicroPython driver. Its now more like a
normal Python sequence and features slice support,reprandlensupport.Colors are stored as tuples by default. However, you can also use int hex syntax
to set values similar to colors on the web. For example,0x100000(#100000on the web) is equivalent to(0x10, 0, 0).NoteThe int hex API represents the brightness of the white pixel when
present by setting the RGB channels to identical values. For example, full
white is 0xffffff but is actually (0, 0, 0, 0xff) in the tuple syntax. Setting
a pixel value with an int will use the white pixel if the RGB channels are
identical. For full, independent, control of each color component use the
tuple syntax.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-neopixelTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-neopixelTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-neopixelUsage ExampleThis example demonstrates the library with the single built-in NeoPixel on theFeather M0 ExpressandMetro M0 Express.importboardimportneopixelpixels=neopixel.NeoPixel(board.NEOPIXEL,1)pixels[0]=(10,0,0)This example demonstrates the library with the ten built-in NeoPixels on theCircuit Playground Express. It turns
offauto_writeso that all pixels are updated at once when theshowmethod is called.importboardimportneopixelpixels=neopixel.NeoPixel(board.NEOPIXEL,10,auto_write=False)pixels[0]=(10,0,0)pixels[9]=(0,10,0)pixels.show()This example demonstrates using a single NeoPixel tied to a GPIO pin and with
apixel_orderto specify the color channel order. Note thatbppdoes not
need to be specified as it is computed from the suppliedpixel_order.importboardimportneopixelpixel=neopixel.NeoPixel(board.D0,1,pixel_order=neopixel.RGBW)pixel[0]=(30,0,20,10)Setup for sudo-less usage on Raspberry Pi boardsEnable both SPI and Serial port hardware (Serial interface). Do it byraspi-configtool or manually by addingdtparam=spi=on
enable_uart=1to the/boot/config.txtReboot the Pi to apply the changes - the hardware setup takes place during boot.Connect LED’s DIN toGPIO10(physical pin 19)When initializing theNeoPixelobjectalwaysdo it withboard.D10(GPIO10)importboardimportneopixelDATA_PIN=board.D10pixel=neopixel.NeoPixel(DATA_PIN,...)Now you can execute the code usingpythonwithoutsudoDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-neopixel-spi | IntroductionSPI driven CircuitPython driver for NeoPixels.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePixelbufPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-neopixel-spiTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-neopixel-spiTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-neopixel-spiUsage Exampleimportboardimportneopixel_spipixels=neopixel_spi.NeoPixel_SPI(board.SPI(),10)pixels.fill(0xff0000)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-neopxl8 | IntroductionPIO-driven 8-way concurrent NeoPixel driver for RP2040DependenciesThis driver depends on:Adafruit CircuitPythonpioasmPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstallneopxl8Or the following command to update an existing version:circupupdateUsage ExampleSee theExamples pagefor a full example. This example shows how to set up 8 30-pixel LED strands on an Adafruit Feather Scorpio RP2040 and set them all to dim red:importtimeimportboardfromadafruit_neopxl8importNeoPxl8# Customize for your strands herenum_strands=8strand_length=30first_led_pin=board.NEOPIXEL0num_pixels=num_strands*strand_length# Make the object to control the pixelspixels=NeoPxl8(first_led_pin,num_pixels,num_strands=num_strands,)pixels.fill(0x01_00_00)whileTrue:time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-neotrellis | IntroductionThis is a library for using the Adafruit_NeoTrellis boards with circuitpython.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterAdafruit SeesawPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-neotrellisTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-neotrellisTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-neotrellisUsage Examplesee examples/neotrellis_simpletest.py for usage exampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ntp | IntroductionNetwork Time Protocol (NTP) helper for CircuitPython.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ntpTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ntpTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ntpUsage Exampleimportadafruit_ntpimportsocketpoolimporttimeimportwifi# Get wifi details and more from a secrets.py filetry:fromsecretsimportsecretsexceptImportError:print("WiFi secrets are kept in secrets.py, please add them there!")raisewifi.radio.connect(secrets["ssid"],secrets["password"])pool=socketpool.SocketPool(wifi.radio)ntp=adafruit_ntp.NTP(pool,tz_offset=0)whileTrue:print(ntp.datetime)time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-nunchuk | IntroductionCircuitPython library for Nintendo Nunchuk controllerDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Works with the Wii controller (Nunchuck / Wiichuck).Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-nunchukTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-nunchukTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-nunchukInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_nunchukOr the following command to update an existing version:circupupdateUsage ExampleSee nunchuk_simpletest.py in examples folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-oauth2 | IntroductionCircuitPython helper for OAuth2.0 authorization to access Google APIs.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-oauth2To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-oauth2To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-oauth2Usage ExampleUsage example for different network interfaces are avaliable within the examples folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-onewire | IntroductionClasses for use in communicating with devices on a 1-Wire bus.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Note:This library doesnotwork on the Raspberry Pi as there is no kernel interface for itUsage Exampleimportboardfromadafruit_onewire.busimportOneWireBusow_bus=OneWireBus(board.D2)devices=ow_bus.scan()fordindevices:print("ROM={}\tFamily=0x{:02x}".format(d.rom,d.family_code))DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ov2640 | IntroductionCircuitPython driver for OV2640 Camera.This driver is designed to work directly with the OV2640 camera module through an 18-pin header.
It does not work with products such as ArduCam which process the camera data themselves.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.ESP32-S2 Kaluga Dev Kit featuring ESP32-S2 WROVERUsage ExampleUsing the ESP32-S2 Kaluga Dev Kit and its included camera, capture a 160x120 image into a buffer:importboardfromadafruit_ov2640importOV2640,OV2640_SIZE_QQVGAbus=busio.I2C(scl=board.CAMERA_SIOC,sda=board.CAMERA_SIOD)cam=OV2640(bus,data_pins=board.CAMERA_DATA,clock=board.CAMERA_PCLK,vsync=board.CAMERA_VSYNC,href=board.CAMERA_HREF,mclk=board.CAMERA_XCLK,size=OV2640_SIZE_QQVGA,)buf=bytearray(2*cam.width*cam.height)cam.capture(buf)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ov5640 | IntroductionCircuitPython driver for OV5640 CameraInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_ov5640Or the following command to update an existing version:circupupdateUsage ExampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ov7670 | IntroductionCircuitPython driver for OV7670 camerasWarningThis module requires the CircuitPythonimagecapturemodule which is only in the unreleased development version (“Absolute Newest”) of CircuitPython and is only supported on specific boards.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Usage ExampleOn an Adafruit Metro M4 Grand Central, capture a 40x30 image into a buffer:importboardfromadafruit_ov7670importOV7670cam=OV7670(bus,data_pins=[board.PCC_D0,board.PCC_D1,board.PCC_D2,board.PCC_D3,board.PCC_D4,board.PCC_D5,board.PCC_D6,board.PCC_D7],clock=board.PCC_CLK,vsync=board.PCC_DEN1,href=board.PCC_DEN2,mclk=board.D29,shutdown=board.D39,reset=board.D38,)cam.size=OV7670_SIZE_DIV16buf=bytearray(2*cam.width*cam.height)cam.capture(buf)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pastebin | IntroductionCircuitPython library for interacting with online pastebin servicesDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pastebinTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pastebinTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-pastebinInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstallpastebinOr the following command to update an existing version:circupupdateUsage ExampleSee theexamples/folder for example usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pca9554 | IntroductionCircuitPython library for Adafruit PCA9554 GPIO expandersDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Adafruit Qualia ESP32-S3 for TTL RGB-666 DisplaysPurchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pca9554To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pca9554To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-pca9554Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pca9554Or the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportdigitalioimportadafruit_pca9554board.I2C().deinit()i2c=board.I2C()tft_io_expander=dict(board.TFT_IO_EXPANDER)pcf=adafruit_pca9554.PCA9554(i2c,address=tft_io_expander['i2c_address'])button_up=pcf.get_pin(board.BTN_UP)button_up.switch_to_input(pull=digitalio.Pull.UP)whileTrue:print(button_up.value)time.sleep(0.01)# debounceDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pca9685 | IntroductionDriver for the PCA9685, a 16-channel, 12-bit PWM chipDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pca9685To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pca9685To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pca9685Usage ExampleSee examples/pca9685_simpletest.py for a demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcd8544 | IntroductionA display control library for Nokia 5110 PCD8544 monochrome displaysDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pcd8544To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcd8544To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pcd8544Usage ExampleSee examples folder for demos of pixels, lines, and text!DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcf8523 | Introduction to Adafruit’s PCF8523 Real Time Clock (RTC) LibraryThis is a great battery-backed real time clock (RTC) that allows your
microcontroller project to keep track of time even if it is reprogrammed,
or if the power is lost. Perfect for datalogging, clock-building, time
stamping, timers and alarms, etc. Equipped with PCF8523 RTC - it can
run from 3.3V or 5V power & logic!The PCF8523 is simple and inexpensive but not a high precision device.
It may lose or gain up to two seconds a day. For a high-precision,
temperature compensated alternative, please check out theDS3231 precision RTC.If you need a DS1307 for compatibility reasons, check out ourDS1307 RTC breakout.DependenciesThis driver depends on theRegisterandBus Devicelibraries. Please ensure they are also available on the CircuitPython filesystem.
This is easily achieved by downloadinga library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pcf8523To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcf8523To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pcf8523Usage NotesBasicsOf course, you must import the library to use it:importtimefromadafruit_pcf8523.pcf8523importPCF8523All the Adafruit RTC libraries take an instantiated and active I2C object
(from theboardlibrary) as an argument to their constructor. The way to
create an I2C object depends on the board you are using. For boards with labeled
SCL and SDA pins, you can:importboardNow, to initialize the I2C bus:i2c=board.I2C()Once you have created the I2C interface object, you can use it to instantiate
the RTC object:rtc=PCF8523(i2c)Date and timeTo set the time, you need to set datetime` to atime.struct_timeobject:rtc.datetime=time.struct_time((2017,1,9,15,6,0,0,9,-1))After the RTC is set, you retrieve the time by reading thedatetimeattribute and access the standard attributes of a struct_time such astm_year,tm_hourandtm_min.t=rtc.datetimeprint(t)print(t.tm_hour,t.tm_min)AlarmTo set the time, you need to setalarmto a tuple with atime.struct_timeobject and string representing the frequency such as “hourly”:rtc.alarm=(time.struct_time((2017,1,9,15,6,0,0,9,-1)),"daily")After the RTC is set, you retrieve the alarm status by reading thealarm_statusattribute. Once True, set it back to False to reset.ifrtc.alarm_status:print("wake up!")rtc.alarm_status=FalseDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcf8563 | Introduction to Adafruit’s PCF8563 Real Time Clock (RTC) LibraryThis is a great battery-backed real time clock (RTC) that allows your
microcontroller project to keep track of time even if it is reprogrammed,
or if the power is lost. Perfect for datalogging, clock-building, time
stamping, timers and alarms, etc.The PCF8563 is simple and inexpensive but not a high precision device.
It may lose or gain multiple seconds a day. For a high-precision,
temperature compensated alternative, please check out theDS3231 precision RTC.If you need a DS1307 for compatibility reasons, check out ourDS1307 RTC breakout.DependenciesThis driver depends on theRegisterandBus Devicelibraries. Please ensure they are also available on the CircuitPython filesystem.
This is easily achieved by downloadinga library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pcf8563To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcf8563To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pcf8563Usage NotesBasicsOf course, you must import the library to use it:importbusiofromadafruit_pcf8563.pcf8563importPCF8563importtimeAll the Adafruit RTC libraries take an instantiated and active I2C object
(from thebusiolibrary) as an argument to their constructor. The way to
create an I2C object depends on the board you are using. For boards with labeled
SCL and SDA pins, you can:fromboardimport*Now, to initialize the I2C bus:i2c_bus=board.I2C()Once you have created the I2C interface object, you can use it to instantiate
the RTC object:rtc=PCF8563(i2c_bus)Date and timeTo set the time, you need to setdatetimeto atime.struct_timeobject:rtc.datetime=time.struct_time((2017,1,9,15,6,0,0,9,-1))After the RTC is set, you retrieve the time by reading thedatetimeattribute and access the standard attributes of a struct_time such astm_year,tm_hourandtm_min.t=rtc.datetimeprint(t)print(t.tm_hour,t.tm_min)AlarmTo set the time, you need to setalarmto a tuple with atime.struct_timeobject and string representing the frequency such as “hourly”:rtc.alarm=(time.struct_time((2017,1,9,15,6,0,0,9,-1)),"daily")After the RTC is set, you retrieve the alarm status by reading thealarm_statusattribute. Once True, set it back to False to reset.ifrtc.alarm_status:print("wake up!")rtc.alarm_status=FalseDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcf8574 | IntroductionPython library for PCF8574 GPIO expanderDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Designed for use with the Adafruit PCF8574 GPIO expander breakout board.Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pcf8574To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcf8574To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pcf8574Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pcf8574Or the following command to update an existing version:circupupdateUsage ExampleExample usage of the library can be found in theexamples/folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcf8575 | IntroductionCircuitPython library for Adafruit PCF8575 GPIO expanderDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pcf8575To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcf8575To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-pcf8575Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pcf8575Or the following command to update an existing version:circupupdateUsage ExampleSee theexamples/folder for usage examples.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pcf8591 | IntroductionADC+DAC ComboDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pcf8591To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pcf8591To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pcf8591Usage Exampleimporttimeimportboardimportadafruit_pcf8591.pcf8591asPCFfromadafruit_pcf8591.analog_inimportAnalogInfromadafruit_pcf8591.analog_outimportAnalogOut############# AnalogOut & AnalogIn Example ############################ This example shows how to use the included AnalogIn and AnalogOut# classes to set the internal DAC to output a voltage and then measure# it with the first ADC channel.## Wiring:# Connect the DAC output to the first ADC channel, in addition to the# normal power and I2C connections######################################################################i2c=board.I2C()pcf=PCF.PCF8591(i2c)pcf_in_0=AnalogIn(pcf,PCF.A0)pcf_out=AnalogOut(pcf,PCF.OUT)whileTrue:print("Setting out to ",65535)pcf_out.value=65535raw_value=pcf_in_0.valuescaled_value=(raw_value/65535)*pcf_in_0.reference_voltageprint("Pin 0:%0.2fV"%(scaled_value))print("")time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pct2075 | IntroductionCircuitPython library for theNXP PCT2075Digital Temperature SensorAlso supports the MicrochipTC74DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pct2075To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pct2075To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pct2075Usage Exampleimporttimeimportboardimportadafruit_pct2075i2c=board.I2C()# uses board.SCL and board.SDApct=adafruit_pct2075.PCT2075(i2c)whileTrue:print("Temperature:%.2fC"%pct.temperature)time.sleep(0.5)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pioasm | IntroductionSimple assembler to convert pioasm to bytesDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pioasmTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pioasmTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pioasmUsage Exampleimporttimeimportrp2pioimportboardimportadafruit_pioasmsquarewave="""
.program squarewave
set pins 1 [1] ; Drive pin high and then delay for one cycle
set pins 0 ; Drive pin low
"""assembled=adafruit_pioasm.assemble(squarewave)sm=rp2pio.StateMachine(assembled,frequency=2000,init=adafruit_pioasm.assemble("set pindirs 1"),first_set_pin=board.LED,)print("real frequency",sm.frequency)time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pixelbuf | IntroductionA pure Python implementation of adafruit_pixelbuf for smaller boards.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pixelbufTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pixelbufTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pixelbufInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pixelbufOr the following command to update an existing version:circupupdateUsage ExampleThis example tests that pixelbuf works.classTestBuf(adafruit_pixelbuf.PixelBuf):called=Falsedefshow(self):self.called=Truebuffer=TestBuf(20,bytearray(20*3),"RGB",1.0,auto_write=True)buffer[0]=(1,2,3)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pixel-framebuf | IntroductionNeopixel and Dotstar Framebuffer HelperDependenciesThis driver depends on:Adafruit CircuitPythonAdafruit LED AnimationAdafruit framebufPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pixel-framebufTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pixel-framebufTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pixel-framebufUsage Example"""
This example runs on an Adafruit NeoPixel Feather
"""importboardimportneopixelfromadafruit_pixel_framebufimportPixelFramebufferpixel_pin=board.D6pixel_width=8pixel_height=4pixels=neopixel.NeoPixel(pixel_pin,pixel_width*pixel_height,brightness=0.1,auto_write=False,)pixel_framebuf=PixelFramebuffer(pixels,pixel_width,pixel_height,alternating=False,)pixel_framebuf.fill(0x000088)pixel_framebuf.pixel(5,1,0xFFFF00)pixel_framebuf.line(0,0,pixel_width-1,pixel_height-1,0x00FF00)pixel_framebuf.display()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pixelmap | IntroductionCircuitPython library for mapping multiple neopixels to behave as one for the purposes of setting colors or showing animations.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.NeoPixel ProductsInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-pixelmapTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pixelmapTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-pixelmapInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pixelmapOr the following command to update an existing version:circupupdateUsage Exampleimportboardimportneopixelimporttimefromadafruit_pixelmapimportPixelMap,horizontal_strip_gridmap,vertical_strip_gridmap# Update to match the pin connected to your NeoPixelspixel_pin=board.NEOPIXEL# Update to match the number of NeoPixels you have connectedpixel_num=32pixels=neopixel.NeoPixel(pixel_pin,pixel_num,brightness=0.1,auto_write=True)pixel_wing_vertical=PixelMap.vertical_lines(pixels,8,4,horizontal_strip_gridmap(8,alternating=False))pixel_wing_horizontal=PixelMap.horizontal_lines(pixels,8,4,horizontal_strip_gridmap(8,alternating=False))forrowinrange(len(pixel_wing_horizontal)):pixels.fill(0x00000)pixel_wing_horizontal[row]=0x00ff00time.sleep(0.3)forrowinrange(len(pixel_wing_vertical)):pixels.fill(0x00000)pixel_wing_vertical[row]=0xff00fftime.sleep(0.3)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pixie | IntroductionDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pixieTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pixieTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pixieUsage Exampleimporttimeimportboardfromrainbowioimportcolorwheelimportadafruit_pixieimportbusiouart=busio.UART(board.TX,rx=None,baudrate=115200)num_pixies=2# Change this to the number of Pixies LEDs you have.pixies=adafruit_pixie.Pixie(uart,num_pixies,brightness=0.2,auto_write=False)whileTrue:foriinrange(255):forpixieinrange(num_pixies):pixies[pixie]=colorwheel(i)pixies.show()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pm25 | IntroductionCircuitPython library for PM2.5 Air Quality SensorsDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPINoteThis library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pm25To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pm25To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pm25Usage ExampleFor example usage, see examples/pm25_simpletest.pyDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pn532 | IntroductionCircuitPython driver for thePN532 NFC/RFID BreakoutandPN532 NFC/RFID ShieldDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pn532To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pn532To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pn532Usage ExampleCheck examples/pn532_simpletest.py for usage exampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-portalbase | IntroductionBase Library for the Portal-style libraries. This library only contains base classes and is not
intended to be run on its own.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-portalbaseTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-portalbaseTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-portalbaseDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-progressbar | IntroductionDynamic progress bar widget for CircuitPython displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-progressbarTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-progressbarTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-progressbarUsage ExampleAn for this library is within the examples directory.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pybadger | IntroductionBadge-focused CircuitPython helper library for PyBadge, PyBadge LC, PyGamer, CLUE, and Mag Tag.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pybadgerTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pybadgerTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-pybadgerUsage Examplefromadafruit_pybadgerimportpybadgerpybadger.show_badge(name_string="Blinka",hello_scale=2,my_name_is_scale=2,name_scale=3)whileTrue:pybadger.auto_dim_display(delay=10)ifpybadger.button.a:pybadger.show_business_card(image_name="Blinka.bmp",name_string="Blinka",name_scale=2,email_string_one="blinka@",email_string_two="adafruit.com")elifpybadger.button.b:pybadger.show_qr_code(data="https://circuitpython.org")elifpybadger.button.start:pybadger.show_badge(name_string="Blinka",hello_scale=2,my_name_is_scale=2,name_scale=3)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pycamera | IntroductionLibrary for the Adafruit PyCameraDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIThis package is available on PyPI so that it can be installed by Thonny. It is
not useful to install this package from PyPI on a Windows, Mac, or Linux
computer.Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_pycameraOr the following command to update an existing version:circupupdateUsage ExampleDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-PYOA | IntroductionA CircuitPython ‘Choose Your Own Adventure’ framework for PyPortal.DependenciesThis driver depends on:Adafruit CircuitPython <https://github.com/adafruit/circuitpython>Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportadafruit_sdcardimportstoragefromadafruit_pyoaimportPYOA_Graphicsimportboardimportdigitaliotry:sdcard=adafruit_sdcard.SDCard(board.SPI(),digitalio.DigitalInOut(board.SD_CS))vfs=storage.VfsFat(sdcard)storage.mount(vfs,"/sd")print("SD card found")# no biggieexceptOSError:print("No SD card found")# no biggiegfx=PYOA_Graphics()gfx.load_game("/cyoa")current_card=0# start with first cardwhileTrue:print("Current card:",current_card)current_card=gfx.display_card(current_card)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-pypixelbuf | IntroductionPure python implementation of _pixelbuf for smaller boards.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-pypixelbufTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-pypixelbufTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-pypixelbufUsage ExampleThis example tests that pypixelbuf works.classTestBuf(adafruit_pypixelbuf.PixelBuf):called=Falsedefshow(self):self.called=Truebuffer=TestBuf(20,bytearray(20*3),"RGB",1.0,auto_write=True)buffer[0]=(1,2,3)DocumentationAPI documentation for this library can be found onRead the Docs.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.DocumentationFor information on building library documentation, please check outthis guide. |
adafruit-circuitpython-pyportal | IntroductionCircuitPython driver for Adafruit PyPortal.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage ExampleSee examples/pyportal_simpletest.pyDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-qualia | IntroductionPortal Style Library for the Adafruit Qualia ESP32-S3DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Adafruit Qualia ESP32-S3 for TTL RGB-666 DisplaysPurchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-qualiaTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-qualiaTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-qualiaInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_qualiaOr the following command to update an existing version:circupupdateUsage Examplefromadafruit_qualiaimportQualiafromadafruit_qualia.graphicsimportDisplays# Set a data source URLTEXT_URL="http://wifitest.adafruit.com/testwifi/index.html"# Create the PyPortal objectqualia=Qualia(Displays.SQUARE34,url=TEXT_URL)# Go get that dataprint("Fetching text from",TEXT_URL)data=qualia.fetch()# Print out what we gotprint("-"*40)print(data)print("-"*40)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-qwiictwist | IntroductionCircuitPython library for Sparkfun Qwiic Twist RGB Rotary Encoder. This library is ported fromSparkFun Qwiic Twist Arduino LibrarySparkFun Qwiic Twist RGB Rotary Encoder (DEV-15083)DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit Bus DeviceQwiic Twist RGB Rotary Encoder HardwarePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Raspberry Pi SetupAdafruit has an excellent tutorial onInstalling CircuitPython Libraries on Raspberry Pi.Quick Start Summary:Start with the latest version of Raspbian with Wifi configured.Enable SSH, I2C and SPI.sudoraspi-configUpdate your system to the latest version.sudoapt-getupdatesudoapt-getupgradeUpdate the python toolssudopip3install--upgradesetuptools(If pip3 is not installed, install it and rerun the command)sudoapt-getinstallpython3-pipInstall the CircuitPython librariespip3installRPI.GPIOpip3installadafruit-blinkaInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.Installing this library will also install the dependency adafruit-circuitpython-busdevice.Installing from PyPIpip3installsparkfun-circuitpython-qwiictwistTo install system-wide (this may be required in some cases):sudopip3installsparkfun-circuitpython-qwiictwistTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installsparkfun-circuitpython-qwiictwistUsage ExampleQwiic Twist Hookup Guide- The Arduino examples in the Hookup Guide are available for Python with this libraryCircuitPython on a Raspberry Pi- Basic information on how to install CircuitPython on a Raspberry Pi.Code Example:# import the CircuitPython board and busio librariesimportboardimportbusio# Create bus object using the board's I2C porti2c=busio.I2C(board.SCL,board.SDA)twist=QwiicTwist(i2c)# default address is 0x3F# For a different address use QwiicTwist(i2c, address)
# twist = QwiicTwist(i2c, 0x3E)ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.envsource.env/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.env/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixsparkfun-circuitpython-qwiictwist--library_location.Sphinx documentationSphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):python3-mvenv.envsource.env/bin/activatepipinstallSphinxsphinx-rtd-themeNow, once you have the virtual environment activated:cddocssphinx-build-E-W-bhtml._build/htmlThis will output the documentation todocs/_build/html. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.License InformationThis product isopen source!Please review the LICENSE.md file for license information.Please use, reuse, and modify these files as you see fit.Please maintain the attributions to SparkFun Electronics and Adafruit and release any derivative under the same license.Distributed as-is; no warranty is given. |
adafruit-circuitpython-ra8875 | IntroductionThis is a full featured CircuitPython Library for the RA8875 that included all of the hardware
accelerated drawing functions as the original Arduino library. A lot of the functionality has
been streamlined with a focus on ease of use that is still flexible enough to make full use of
the hardware. For instace, Graphics and Text mode switching is now automatic and handled in the
background.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ra8875To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ra8875To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ra8875Usage ExampleSee examples/ra8875_simpletest.py and examples/ra8875_bmptest.py for examples of the module’s usage. When
running the bmptest, be sure to upload the blinka.bmp image to the root folder as well.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-radial-controller | IntroductionHID Radial Controller device helper libraryDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-radial-controllerTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-radial-controllerTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-radial-controllerInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_radial_controllerOr the following command to update an existing version:circupupdateDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-register | IntroductionThis library provides a variety of data descriptor class forAdafruit
CircuitPythonthat makes it really
simple to write a device drivers for a I2C and SPI register based devices. Data
descriptors act like basic attributes from the outside which makes using them
really easy to use.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-registerTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-registerTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-registerUsage ExampleCreating a driverCreating a driver with the register library is really easy. First, import the
register modules you need from theavailable modules:fromadafruit_registerimporti2c_bitfromadafruit_bus_deviceimporti2c_deviceNext, define where the bit is located in the device’s memory map:classHelloWorldDevice:"""Device with two bits to control when the words 'hello' and 'world' are lit."""hello=i2c_bit.RWBit(0x0,0x0)"""Bit to indicate if hello is lit."""world=i2c_bit.RWBit(0x1,0x0)"""Bit to indicate if world is lit."""Lastly, we need to add ani2c_devicemember of typeI2CDevicethat manages sharing the I2C bus for us. Make sure the name is exact, otherwise
the registers will not be able to find it. Also, make sure that the i2c device
implements thebusio.I2Cinterface.def__init__(self,i2c,device_address=0x0):self.i2c_device=i2c_device.I2CDevice(i2c,device_address)Thats it! Now we have a class we can use to talk to those registers:importbusiofromboardimport*withbusio.I2C(SCL,SDA)asi2c:device=HelloWorldDevice(i2c)device.hello=Truedevice.world=TrueAdding register typesAdding a new register type is a little more complicated because you need to be
careful and minimize the amount of memory the class will take. If you don’t,
then a driver with five registers of your type could take up five times more
extra memory.First, determine whether the new register class should go in an existing module
or not. When in doubt choose a new module. The more finer grained the modules
are, the fewer extra classes a driver needs to load in.Here is the start of theRWBitclass:classRWBit:"""
Single bit register that is readable and writeable.
Values are `bool`
:param int register_address: The register address to read the bit from
:param type bit: The bit index within the byte at ``register_address``
"""def__init__(self,register_address,bit):self.bit_mask=1<<bitself.buffer=bytearray(2)self.buffer[0]=register_addressThe first thing done is writing an RST formatted class comment that explains the
functionality of the register class and any requirements of the register layout.
It also documents the parameters passed into the constructor (__init__) which
configure the register location in the device map. It does not include the
device address or the i2c object because its shared on the device class instance
instead. That way if you have multiple of the same device on the same bus, the
register classes will be shared.In__init__we only use two member variable because each costs 8 bytes of
memory plus the memory for the value. And remember this gets multiplied by the
number of registers of this type in a driver! Thats why we pack both the
register address and data byte into one bytearray. We could use two byte arrays
of size one but each MicroPython object is 16 bytes minimum due to the garbage
collector. So, by sharing a byte array we keep it to the 16 byte minimum instead
of 32 bytes. Eachmemoryviewalso costs 16 bytes minimum so we avoid them too.Another thing we could do is allocate thebytearrayonly when we need it. This
has the advantage of taking less memory up front but the cost of allocating it
every access and risking it failing. If you want to add a version ofFoothat
lazily allocates the underlying buffer call itFooLazy.Ok, onward. To make adata descriptorwe must implement__get__and__set__.def__get__(self,obj,objtype=None):withobj.i2c_deviceasi2c:i2c.write_then_readinto(self.buffer,self.buffer,out_end=1,in_start=1)returnbool(self.buffer[1]&self.bit_mask)def__set__(self,obj,value):withobj.i2c_deviceasi2c:i2c.write_then_readinto(self.buffer,self.buffer,out_end=1,in_start=1)ifvalue:self.buffer[1]|=self.bit_maskelse:self.buffer[1]&=~self.bit_maskobj.i2c_device.write(self.buffer)As you can see, we have two places to get state from. First,selfstores the
register class members which locate the register within the device memory map.
Second,objis the driver class that uses the register class which must by
definition provide aI2CDevicecompatible
object asi2c_device. This object does two thing for us:Waits for the bus to free, locks it as we use it and frees it after.Saves the device address and other settings so we don’t have to.Note that we take heavy advantage of thestartandendparameters to the
i2c functions to slice the buffer without actually allocating anything extra.
They function just likeself.buffer[start:end]without the extra allocation.Thats it! Now you can use your new register class like the example above. Just
remember to keep the number of members to a minimum because the class may be
used a bunch of times.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-register-spi | IntroductionPython data descriptor classes to represent hardware registers on SPI devices.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-register-spiTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-register-spiTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-register-spiInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstallregister_spiOr the following command to update an existing version:circupupdateUsage ExampleCreating a driverCreating a driver with the register library is really easy. First, import the
register modules you need from theavailable modules:fromadafruit_registerimporti2c_bitfromadafruit_bus_deviceimporti2c_deviceNext, define where the bit is located in the device’s memory map:classHelloWorldDevice:"""Device with two bits to control when the words 'hello' and 'world' are lit."""hello=i2c_bit.RWBit(0x0,0x0)"""Bit to indicate if hello is lit."""world=i2c_bit.RWBit(0x1,0x0)"""Bit to indicate if world is lit."""Lastly, we need to add ani2c_devicemember of typeI2CDevicethat manages sharing the I2C bus for us. Make sure the name is exact, otherwise
the registers will not be able to find it. Also, make sure that the i2c device
implements thebusio.I2Cinterface.def__init__(self,i2c,device_address=0x0):self.i2c_device=i2c_device.I2CDevice(i2c,device_address)Thats it! Now we have a class we can use to talk to those registers:importbusiofromboardimport*withbusio.I2C(SCL,SDA)asi2c:device=HelloWorldDevice(i2c)device.hello=Truedevice.world=TrueAdding register typesAdding a new register type is a little more complicated because you need to be
careful and minimize the amount of memory the class will take. If you don’t,
then a driver with five registers of your type could take up five times more
extra memory.First, determine whether the new register class should go in an existing module
or not. When in doubt choose a new module. The more finer grained the modules
are, the fewer extra classes a driver needs to load in.Here is the start of theRWBitclass:classRWBit:"""
Single bit register that is readable and writeable.
Values are `bool`
:param int register_address: The register address to read the bit from
:param type bit: The bit index within the byte at ``register_address``
"""def__init__(self,register_address,bit):self.bit_mask=1<<bitself.buffer=bytearray(2)self.buffer[0]=register_addressThe first thing done is writing an RST formatted class comment that explains the
functionality of the register class and any requirements of the register layout.
It also documents the parameters passed into the constructor (__init__) which
configure the register location in the device map. It does not include the
device address or the i2c object because its shared on the device class instance
instead. That way if you have multiple of the same device on the same bus, the
register classes will be shared.In__init__we only use two member variable because each costs 8 bytes of
memory plus the memory for the value. And remember this gets multiplied by the
number of registers of this type in a driver! Thats why we pack both the
register address and data byte into one bytearray. We could use two byte arrays
of size one but each MicroPython object is 16 bytes minimum due to the garbage
collector. So, by sharing a byte array we keep it to the 16 byte minimum instead
of 32 bytes. Eachmemoryviewalso costs 16 bytes minimum so we avoid them too.Another thing we could do is allocate thebytearrayonly when we need it. This
has the advantage of taking less memory up front but the cost of allocating it
every access and risking it failing. If you want to add a version ofFoothat
lazily allocates the underlying buffer call itFooLazy.Ok, onward. To make adata descriptorwe must implement__get__and__set__.def__get__(self,obj,objtype=None):withobj.i2c_deviceasi2c:i2c.write_then_readinto(self.buffer,self.buffer,out_end=1,in_start=1)returnbool(self.buffer[1]&self.bit_mask)def__set__(self,obj,value):withobj.i2c_deviceasi2c:i2c.write_then_readinto(self.buffer,self.buffer,out_end=1,in_start=1)ifvalue:self.buffer[1]|=self.bit_maskelse:self.buffer[1]&=~self.bit_maskobj.i2c_device.write(self.buffer)As you can see, we have two places to get state from. First,selfstores the
register class members which locate the register within the device memory map.
Second,objis the driver class that uses the register class which must by
definition provide aI2CDevicecompatible
object asi2c_device. This object does two thing for us:Waits for the bus to free, locks it as we use it and frees it after.Saves the device address and other settings so we don’t have to.Note that we take heavy advantage of thestartandendparameters to the
i2c functions to slice the buffer without actually allocating anything extra.
They function just likeself.buffer[start:end]without the extra allocation.Thats it! Now you can use your new register class like the example above. Just
remember to keep the number of members to a minimum because the class may be
used a bunch of times.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-requests | IntroductionA requests-like library for HTTP commands.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-requestsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-requestsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-requestsUsage ExampleUsage examples are within theexamplessubfolder of this library.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rfm69 | IntroductionCircuitPython RFM69 packet radio module. This supports basic RadioHead-compatible sending and
receiving of packets with RFM69 series radios (433/915Mhz).WarningThis is NOT for LoRa radios!NoteThis is a ‘best effort’ at receiving data using pure Python code–there is not interrupt
support so you might lose packets if they’re sent too quickly for the board to process them.
You will have the most luck using this in simple low bandwidth scenarios like sending and
receiving a 60 byte packet at a time–don’t try to receive many kilobytes of data at a time!DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rfm69To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rfm69To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rfm69Usage ExampleSee examples/rfm69_simpletest.py for a simple demo of the usage.
Note: the default baudrate for the SPI is 2000000 (2MHz).
The maximum setting is 10Mhz but
transmission errors have been observed expecially when using breakout boards.
For breakout boards or other configurations where the boards are separated,
it may be necessary to reduce the baudrate for reliable data transmission.
The baud rate may be specified as an keyword parameter when initializing the board.
To set it to 1000000 use :# Initialze RFM radiorfm9x=adafruit_rfm9x.RFM9x(spi,CS,RESET,RADIO_FREQ_MHZ,baudrate=1000000)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rfm9x | IntroductionCircuitPython module for the RFM95/6/7/8 LoRa 433/915mhz radio modules.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rfm9xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rfm9xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rfm9xUsage ExampleInitialization of the RFM radio requires specifying a frequency appropriate to
your radio hardware (i.e. 868-915 or 433 MHz) and specifying the pins used in your
wiring from the controller board to the radio module.This example code matches the wiring used in theLoRa and LoRaWAN Radio for Raspberry Piproject:importdigitalioimportboardimportbusioimportadafruit_rfm9xRADIO_FREQ_MHZ=915.0CS=digitalio.DigitalInOut(board.CE1)RESET=digitalio.DigitalInOut(board.D25)spi=busio.SPI(board.SCK,MOSI=board.MOSI,MISO=board.MISO)rfm9x=adafruit_rfm9x.RFM9x(spi,CS,RESET,RADIO_FREQ_MHZ)Note: the default baudrate for the SPI is 50000000 (5MHz). The maximum setting is 10Mhz but
transmission errors have been observed expecially when using breakout boards.
For breakout boards or other configurations where the boards are separated, it may be necessary to reduce
the baudrate for reliable data transmission.
The baud rate may be specified as an keyword parameter when initializing the board.
To set it to 1000000 use :# Initialze RFM radio with a more conservative baudraterfm9x=adafruit_rfm9x.RFM9x(spi,CS,RESET,RADIO_FREQ_MHZ,baudrate=1000000)Optional controls exist to alter the signal bandwidth, coding rate, and spreading factor
settings used by the radio to achieve better performance in different environments.
By default, settings compatible with RadioHead Bw125Cr45Sf128 mode are used, which can
be altered in the following manner (continued from the above example):# Apply new modem config settings to the radio to improve its effective rangerfm9x.signal_bandwidth=62500rfm9x.coding_rate=6rfm9x.spreading_factor=8rfm9x.enable_crc=TrueSee examples/rfm9x_simpletest.py for an expanded demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rgb-display | IntroductionPort of display drivers fromhttps://github.com/adafruit/micropython-adafruit-rgb-displayto Adafruit CircuitPython for use on Adafruit’s SAMD21-based and other CircuitPython boards.NoteThis driver currently won’t work on micropython.org firmware, instead you want the micropython-adafruit-rgb-display driver linked above!This CircuitPython driver currently supports displays that use the following display-driver chips: HX8353, HX8357, ILI9341, S6D02A1, ST7789, SSD1331, SSD1351, and ST7735 (including variants ST7735R and ST7735S).DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.For the Pillow Examples, you will need to be running CPython. This means using a Single Board Computer
such as a Raspberry Pi or using a chip such as an FT232H on Linux, Window, or Mac. CircuitPython does
not support PIL/pillow (python imaging library)!For improved performance consider installing NumPy.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rgb-displayTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rgb-displayTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rgb-displayUsage Example2.2”, 2.4”, 2.8”, 3.2” TFTimporttimeimportbusioimportdigitaliofromboardimportSCK,MOSI,MISO,D2,D3fromadafruit_rgb_displayimportcolor565importadafruit_rgb_display.ili9341asili9341# Configuration for CS and DC pins:CS_PIN=D2DC_PIN=D3# Setup SPI bus using hardware SPI:spi=busio.SPI(clock=SCK,MOSI=MOSI,MISO=MISO)# Create the ILI9341 display:display=ili9341.ILI9341(spi,cs=digitalio.DigitalInOut(CS_PIN),dc=digitalio.DigitalInOut(DC_PIN))# Main loop:whileTrue:# Clear the displaydisplay.fill(0)# Draw a red pixel in the center.display.pixel(120,160,color565(255,0,0))# Pause 2 seconds.time.sleep(2)# Clear the screen blue.display.fill(color565(0,0,255))# Pause 2 seconds.time.sleep(2)1.14” TFT with Raspbery Pi 4With 1.14”wiring, here is the working code:importtimeimportbusioimportdigitaliofromboardimportSCK,MOSI,MISO,CE0,D24,D25fromadafruit_rgb_displayimportcolor565fromadafruit_rgb_display.st7789importST7789# Configuration for CS and DC pins:CS_PIN=CE0DC_PIN=D25RESET_PIN=D24BAUDRATE=24000000# Setup SPI bus using hardware SPI:spi=busio.SPI(clock=SCK,MOSI=MOSI,MISO=MISO)# Create the ST7789 display:display=ST7789(spi,rotation=90,width=135,height=240,x_offset=53,y_offset=40,baudrate=BAUDRATE,cs=digitalio.DigitalInOut(CS_PIN),dc=digitalio.DigitalInOut(DC_PIN),rst=digitalio.DigitalInOut(RESET_PIN))# Main loop: same as abovewhileTrue:# Clear the displaydisplay.fill(0)# Draw a red pixel in the center.display.pixel(120,160,color565(255,0,0))# Pause 2 seconds.time.sleep(2)# Clear the screen blue.display.fill(color565(0,0,255))# Pause 2 seconds.time.sleep(2)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rgbled | CircuitPython_RGBLEDCircuitPython driver for RGB LEDs. Works with native microcontroller pins,Adafruit Blinka, or thePCA9685 PWM driver.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rgbledTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rgbledTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rgbledUsage ExampleInitialize a common-cathode RGB LED with three PWM-capable pins.importboardimportadafruit_rgbled# Pin the Red LED is connected toRED_LED=board.D5# Pin the Green LED is connected toGREEN_LED=board.D6# Pin the Blue LED is connected toBLUE_LED=board.D7# Create a RGB LED objectled=adafruit_rgbled.RGBLED(RED_LED,BLUE_LED,GREEN_LED)Initialize a common-anode RGB LED with three PWM-capable pinsimportboardimportadafruit_rgbled# Pin the Red LED is connected toRED_LED=board.D5# Pin the Green LED is connected toGREEN_LED=board.D6# Pin the Blue LED is connected toBLUE_LED=board.D7# Create a RGB LED objectled=adafruit_rgbled.RGBLED(RED_LED,BLUE_LED,GREEN_LED,invert_pwm=True)Set the RGB LED’s color to a RGB Tuple (Red, Green, Blue).led.color=(255,0,0)Set the RGB LED’s color to a 24-bit integer (in hex syntax), 0x100000.led.color=0x100000Setting a common-anode RGB LED using a ContextManager:importboardimportadafruit_rgbledwithadafruit_rgbled.RGBLED(board.D5,board.D6,board.D7,invert_pwm=True)asrgb_led:rgb_led.color=(0,255,0)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rockblock | IntroductionCircuitPython driver for Rock Seven RockBLOCK Iridium satellite modemDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPINoteThis library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rockblockTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rockblockTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rockblockUsage Exampleimportboardimportbusio# more laterDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rplidar | IntroductionDependenciesInstall with PyPy:pip install Adafruit_CircuitPython_RPLIDARThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportosfrommathimportfloorfromadafruit_rplidarimportRPLidar# Setup the RPLidarPORT_NAME='/dev/ttyUSB0'lidar=RPLidar(None,PORT_NAME,timeout=3)# used to scale data to fit on the screenmax_distance=0defprocess_data(data):print(data)scan_data=[0]*360try:# print(lidar.get_info())forscaninlidar.iter_scans():for(_,angle,distance)inscan:scan_data[min([359,floor(angle)])]=distanceprocess_data(scan_data)exceptKeyboardInterrupt:print('Stopping.')lidar.stop()lidar.disconnect()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rsa | IntroductionRSA implementation based onSybren A. Stüvel’s python-rsapure-python
RSA implementation.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit CircuitPython Logger Modulepyasn1 Library(some functionality)CPython’srsaLibrary (some functionality)Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rsaTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rsaTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rsaUsage ExampleExamples for this library are avaliable in the examples/ folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-rtttl | IntroductionThis playsRTTTLmelodies.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit CircuitPython WaveformPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-rtttlTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-rtttlTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-rtttlUsage ExampleThis plays Frosty the Snowman:importboardimportadafruit_rtttladafruit_rtttl.play(board.A0,"Snowman:d=8,o=5,b=200:2g,4e.,f,4g,2c6,b,c6,4d6,4c6,4b,a,2g.,b,c6,4d6,4c6,4b,a,a,g,4c6,4e.,g,a,4g,4f,4e,4d,2c.,4c,4a,4a,4c6,4c6,4b,4a,4g,4e,4f,4a,4g,4f,2e.,4e,4d,4d,4g,4g,4b,4b,4d6,d6,b,4d6,4c6,4b,4a,4g,4p,2g")CPX Usage ExampleThis plays Frosty the Snowman on a Circuit Playground Express (we must enable onboard speaker):importboardfromdigitalioimportDigitalInOut,Directionimportadafruit_rtttlspkrenable=DigitalInOut(board.SPEAKER_ENABLE)spkrenable.direction=Direction.OUTPUTspkrenable.value=Trueadafruit_rtttl.play(board.A0,"Snowman:d=8,o=5,b=200:2g,4e.,f,4g,2c6,b,c6,4d6,4c6,4b,a,2g.,b,c6,4d6,4c6,4b,a,a,g,4c6,4e.,g,a,4g,4f,4e,4d,2c.,4c,4a,4a,4c6,4c6,4b,4a,4g,4e,4f,4a,4g,4f,2e.,4e,4d,4d,4g,4g,4b,4b,4d6,d6,b,4d6,4c6,4b,4a,4g,4p,2g")DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-scd30 | IntroductionHelper library for the SCD30 CO2 sensorDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-scd30To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-scd30To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-scd30Usage Exampleimporttimeimportboardimportadafruit_scd30# SCD-30 has tempremental I2C with clock stretching, datasheet recommends# starting at 50KHzi2c=busio.I2C(board.SCL,board.SDA,frequency=50000)scd=adafruit_scd30.SCD30(i2c)whileTrue:# since the measurement interval is long (2+ seconds) we check for new data before reading# the values, to ensure current readings.ifscd.data_available:print("Data Available!")print("CO2:",scd.CO2,"PPM")print("Temperature:",scd.temperature,"degrees C")print("Humidity:",scd.relative_humidity,"%%rH")print("")print("Waiting for new data...")print("")time.sleep(0.5)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-scd4x | IntroductionDriver for Sensirion SCD4X CO2 sensorDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-scd4xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-scd4xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-scd4xInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_scd4xOr the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportadafruit_scd4xi2c=board.I2C()scd4x=adafruit_scd4x.SCD4X(i2c)print("Serial number:",[hex(i)foriinscd4x.serial_number])scd4x.start_periodic_measurement()print("Waiting for first measurement....")whileTrue:ifscd4x.data_ready:print("CO2:%dppm"%scd4x.CO2)print("Temperature:%0.1f*C"%scd4x.temperature)print("Humidity:%0.1f%%"%scd4x.relative_humidity)print()time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sd | IntroductionCircuitPython driver for SD cards. This implements the basic reading and writing
block functionality needed to mount an SD card usingstorage.VfsFat.DependenciesThis driver depends on:Adafruit CircuitPython 2.0.0+Bus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage ExampleMounting a filesystem on an SD card so that its available through the normal Python
ways is easy.Below is an example for the Feather M0 Adalogger. Most of this will stay the same
across different boards with the exception of the pins for the SPI and chip
select (cs) connections.importadafruit_sdcardimportbusioimportdigitalioimportboardimportstorage# Connect to the card and mount the filesystem.spi=busio.SPI(board.SCK,board.MOSI,board.MISO)cs=digitalio.DigitalInOut(board.SD_CS)sdcard=adafruit_sdcard.SDCard(spi,cs)vfs=storage.VfsFat(sdcard)storage.mount(vfs,"/sd")# Use the filesystem as normal.withopen("/sd/test.txt","w")asf:f.write("Hello world\n")Sharing the SPI bus with other devicesImportantIf the same SPI bus is shared with other peripherals, it is important that
the SD card be initialized before accessing any other peripheral on the bus.
Failure to do so can prevent the SD card from being recognized until it is
powered off or re-inserted.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-seesaw | IntroductionCircuitPython module for use with the Adafruit ATSAMD09 seesaw.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-seesawTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-seesawTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-seesawUsage ExampleSee examples/seesaw_simpletest.py for usage example.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-servokit | IntroductionCircuitPython helper library for the PWM/Servo FeatherWing, Shield and Pi HAT and Bonnet kits.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-servokitTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-servokitTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-servokitUsage Exampleimporttimefromadafruit_servokitimportServoKit# Set channels to the number of servo channels on your kit.# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.kit=ServoKit(channels=8)kit.servo[0].angle=180kit.continuous_servo[1].throttle=1time.sleep(1)kit.continuous_servo[1].throttle=-1time.sleep(1)kit.servo[0].angle=0kit.continuous_servo[1].throttle=0DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sgp30 | IntroductionA CircuitPython driver for the Sensirion SGP30 gas sensor with eCO2 and TVOC output. This sensor uses I2C!Installation and DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-sgp30To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-sgp30To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-sgp30Usage NotesSeethe guidefor wiring and installation instructions.First, import the library:importbusioimportadafruit_sgp30Next, initialize the I2C bus object:importboardi2c_bus=busio.I2C(board.SCL,board.SDA,frequency=100000)Since we have the I2C bus object, we can now use it to instantiate the SGP30 object:sgp30=adafruit_sgp30.Adafruit_SGP30(i2c_bus)Reading from the SensorTo read from the sensor:eCO2,TVOC=sgp30.iaq_measure()print("eCO2 =%dppm\tTVOC =%dppb"%(eCO2,TVOC))DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sgp40 | IntroductionCircuitPython library for the Adafruit SGP40 Air Quality Sensor / VOC Index Sensor BreakoutsDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-sgp40To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-sgp40To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-sgp40Usage Exampleimporttimeimportboardimportadafruit_sgp40i2c=board.I2C()# uses board.SCL and board.SDAsgp=adafruit_sgp40.SGP40(i2c)whileTrue:print("Measurement: ",sgp.raw)print("")sleep(1)For humidity compensated raw gas and voc index readings, we’ll need a secondary sensor such as the bme280importtimeimportboardimportadafruit_sgp40importadafruit_bme280i2c=board.I2C()# uses board.SCL and board.SDAsgp=adafruit_sgp40.SGP40(i2c)bme280=adafruit_bme280.Adafruit_BME280_I2C(i2c)whileTrue:temperature=bme280.temperaturehumidity=bme280.relative_humidity# For compensated raw gas readings"""
compensated_raw_gas = sgp.measure_raw(
temperature=temperature, relative_humidity=humidity
)
print("Raw Data:", compensated_raw_gas)
"""# For Compensated voc index readingsvoc_index=sgp.measure_index(temperature=temperature,relative_humidity=humidity)print("VOC Index:",voc_index)print("")time.sleep(1)It may take several minutes for the VOC index to start changing as it calibrates the baseline readings.
The voc algorithm expects a 1 hertz sampling rate. Runmeasure_index()once per second.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sharpmemorydisplay | IntroductionA display control library for Sharp ‘memory’ displaysDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-sharpmemorydisplayTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-sharpmemorydisplayTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-sharpmemorydisplayUsage ExampleSee the examples folder for a demonstration of drawing pixels, lines and textDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sht31d | IntroductionCircuitPython module for the SHT31-D temperature and humidity sensor.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-sht31dTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-sht31dTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-sht31dUsage ExampleYou must import the library to use it:importadafruit_sht31dThis driver takes an instantiated and active I2C object (from thebusioor
thebitbangiolibrary) as an argument to its constructor. The way to create
an I2C object depends on the board you are using.importboardi2c=board.I2C()Once you have created the I2C interface object, you can use it to instantiate
the sensor object:sensor=adafruit_sht31d.SHT31D(i2c)And then you can start measuring the temperature and humidity:print(sensor.temperature)print(sensor.relative_humidity)You can instruct the sensor to periodically measure the temperature and
humidity, storing the result in its internal cache:sensor.mode=adafruit_sht31d.MODE_PERIODICYou can adjust the frequency at which the sensor periodically gathers data to:
0.5, 1, 2, 4 or 10 Hz. The following adjusts the frequency to 2 Hz:sensor.frequency=adafruit_sht31d.FREQUENCY_2The sensor is capable of storing eight results. The sensor stores these
results in an internal FILO cache. Retrieving these results is simlilar to
taking a measurement. The sensor clears its cache once the stored data is read.
The sensor always returns eight data points. The list of results is backfilled
with the maximum output values of 130.0 ºC and 100.01831417975366 % RH:print(sensor.temperature)print(sensor.relative_humidity)The sensor will continue to collect data at the set interval until it is
returned to single shot data acquisition mode:sensor.mode=adafruit_sht31d.MODE_SINGLEDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-sht4x | IntroductionPython library for Sensirion SHT4x temperature and humidity sensorsDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-sht4xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-sht4xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-sht4xUsage Exampleimporttimeimportboardimportadafruit_sht4xi2c=board.I2C()# uses board.SCL and board.SDAsht=adafruit_sht4x.SHT4x(i2c)print("Found SHT4x with serial number",hex(sht.serial_number))sht.mode=adafruit_sht4x.Mode.NOHEAT_HIGHPRECISION# Can also set the mode to enable heater# sht.mode = adafruit_sht4x.Mode.LOWHEAT_100MSprint("Current mode is: ",adafruit_sht4x.Mode.string[sht.mode])whileTrue:temperature,relative_humidity=sht.measurementsprint("Temperature:%0.1fC"%temperature)print("Humidity:%0.1f%%"%relative_humidity)print("")time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-shtc3 | IntroductionA helper library for using the Senserion SHTC3 Humidity and Temperature SensorDependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-shtc3To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-shtc3To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-shtc3Usage Exampleimporttimeimportboardimportadafruit_shtc3i2c=board.I2C()# uses board.SCL and board.SDAsht=adafruit_shtc3.SHTC3(i2c)whileTrue:temperature,relative_humidity=sht.measurementsprint("Temperature:%0.1fC"%temperature)print("Humidity:%0.1f%%"%relative_humidity)print("")time.sleep(1)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-si1145 | IntroductionCircuitPython helper library for the SI1145 Digital UV Index IR Visible Light SensorDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Purchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-si1145To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-si1145To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-si1145Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_si1145Or the following command to update an existing version:circupupdateUsage ExampleSee example in library.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-si4713 | IntroductionCircuitPython module for SI4713 and SI4721 FM RDS transmitter.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-si4713To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-si4713To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-si4713Usage ExampleSee examples/simpletest.py for a demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-si5351 | IntroductionSI5351 clock generator module.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-si5351To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-si5351To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-si5351Usage ExampleSee examples/simpletest.py for a demo of the usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-si7021 | IntroductionCircuitPython module for use with the SI7021 Temperature and Humidity Sensor.DependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-si7021To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-si7021To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-si7021Usage NotesOf course, you must import the library to use it:importadafruit_si7021This driver takes an instantiated and active I2C object (from thebusioor
thebitbangiolibrary) as an argument to its constructor. The way to create
an I2C object depends on the board you are using. For boards with labeled SCL
and SDA pins, you can:frombusioimportI2CfromboardimportSCL,SDAi2c=I2C(SCL,SDA)Once you have created the I2C interface object, you can use it to instantiate
the sensor object:sensor=adafruit_si7021.SI7021(i2c)And then you can start measuring the temperature and humidity:print(sensor.temperature)print(sensor.relative_humidity)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-simpleio | IntroductionSimpleIO features a number of helpers to simplify hardware interactions. Many
of the functions and classes are inspired by Arduino APIs to make it easier to
move to CircuitPython from Arduino.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-simpleioTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-simpleioTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-simpleioUsage ExampleSee the examples in theexamples/folder for usage.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-simplemath | IntroductionMath utility functionsDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-simplemathTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-simplemathTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-simplemathDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-simple-text-display | IntroductionA helper library for displaying lines of text on a display using displayio.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit CircuitPython DisplayTextPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.This library works with any microcontroller with a built in display, or a microcontroller with an
external display connected.Purchase one from the Adafruit shop.Usage ExampleThis example takes the microcontroller CPU temperature in C and F, and displays it on the display
under the heading “Temperature Data!”.importmicrocontrollerfromadafruit_simple_text_displayimportSimpleTextDisplaytemperature_data=SimpleTextDisplay(title="Temperature Data!",title_scale=2)whileTrue:temperature_data[0].text="Temperature:{:.2f}degrees C".format(microcontroller.cpu.temperature)temperature_data[1].text="Temperature:{:.2f}degrees F".format((microcontroller.cpu.temperature*(9/5)+32))temperature_data.show()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-slideshow | IntroductionCircuitPython helper library for displaying a slideshow of images on a display.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-slideshowTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-slideshowTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-slideshowUsage Examplefromadafruit_slideshowimportPlayBackOrder,SlideShowimportboardimportpwmio# Create the slideshow object that plays through once alphabetically.slideshow=SlideShow(board.DISPLAY,pwmio.PWMOut(board.TFT_BACKLIGHT),folder="/",loop=False,order=PlayBackOrder.ALPHABETICAL)whileslideshow.update():passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-spd1656 | IntroductionDriver for SPD1656 driven ACeP (7-color) e-paper displays.Please note that we do not have Blinka support for this yet. So it won’t work with a Raspberry Pi.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.This supports the common 4” and 5.65” ACeP displays.[Waveshare 4”](https://www.waveshare.com/4.01inch-e-paper-hat-f.htm)[Waveshare 5.65”](https://www.waveshare.com/5.65inch-e-paper-module-f.htm)[Pimoroni 5.7”](https://shop.pimoroni.com/products/inky-impression-5-7) (Likely the same as 5.65”.)[Pimoroni 4”](https://shop.pimoroni.com/products/inky-impression-4)Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-spd1656To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-spd1656To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-spd1656Installing to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_spd1656Or the following command to update an existing version:circupupdateUsage Example# SPDX-FileCopyrightText: Copyright (c) 2023 Scott Shawcroft for Adafruit Industries# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries## SPDX-License-Identifier: Unlicense"""Simple test script for 5.6" 600x448 7-color ACeP display.
"""# pylint: disable=no-memberimporttimeimportboardimportdisplayioimportadafruit_spd1656displayio.release_displays()# This pinout works on a Feather RP2040 and may need to be altered for other boards.spi=board.SPI()# Uses SCK and MOSIepd_cs=board.D9epd_dc=board.D10epd_reset=board.D11epd_busy=board.D12display_bus=fourwire.FourWire(spi,command=epd_dc,chip_select=epd_cs,reset=epd_reset,baudrate=1000000)display=adafruit_spd1656.SPD1656(display_bus,width=600,height=448,busy_pin=epd_busy)g=displayio.Group()fn="/display-ruler-720p.bmp"withopen(fn,"rb")asf:pic=displayio.OnDiskBitmap(f)t=displayio.TileGrid(pic,pixel_shader=pic.pixel_shader)g.append(t)display.root_group=gdisplay.refresh()time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1305 | IntroductionFramebuf (non-displayio) driver for SSD1305 displaysDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1305To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1305To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1305Usage Example# Basic example of clearing and drawing pixels on a SSD1305 OLED display.# This example and library is meant to work with Adafruit CircuitPython API.# Author: Tony DiCola# License: Public Domain# Import all board pins.fromboardimportSCL,SDAimportbusio# Import the SSD1305 module.importadafruit_ssd1305# Create the I2C interface.i2c=busio.I2C(SCL,SDA)# Create the SSD1305 OLED class.# The first two parameters are the pixel width and pixel height. Change these# to the right size for your display!display=adafruit_ssd1305.SSD1305_I2C(128,32,i2c)# Alternatively you can change the I2C address of the device with an addr parameter:#display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c, addr=0x31)# Clear the display. Always call show after changing pixels to make the display# update visible!display.fill(0)display.show()DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1306 | IntroductionAdafruit CircuitPython driver for SSD1306 or SSD1305 OLED displays. Note that SSD1305 displays are back compatible so they can be used in-place of SSD1306 with the same code and commands.This driver implements theadafruit_framebuf interface. It isnotthedisplayiodriver for the SSD1306. See theAdafruit CircuitPython DisplayIO SSD1306driver fordisplayiosupport.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceAdafruit framebufPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1306To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1306To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1306Usage Example# Basic example of clearing and drawing pixels on a SSD1306 OLED display.# This example and library is meant to work with Adafruit CircuitPython API.# Author: Tony DiCola# License: Public Domain# Import all board pins.fromboardimportSCL,SDAimportbusio# Import the SSD1306 module.importadafruit_ssd1306# Create the I2C interface.i2c=busio.I2C(SCL,SDA)# Create the SSD1306 OLED class.# The first two parameters are the pixel width and pixel height. Change these# to the right size for your display!display=adafruit_ssd1306.SSD1306_I2C(128,32,i2c)# Alternatively you can change the I2C address of the device with an addr parameter:#display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, addr=0x31)# Clear the display. Always call show after changing pixels to make the display# update visible!display.fill(0)display.show()# Set a pixel in the origin 0,0 position.display.pixel(0,0,1)# Set a pixel in the middle 64, 16 position.display.pixel(64,16,1)# Set a pixel in the opposite 127, 31 position.display.pixel(127,31,1)display.show()More examples and details can be found in theadafruit_framebuf docs.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1322 | IntroductionDisplayIO driver for grayscale OLEDs driven by SSD1322DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1322To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1322To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1322Usage Exampleimporttimeimportboardimportbusioimportdisplayioimportadafruit_ssd1322displayio.release_displays()# This pinout works on a Metro and may need to be altered for other boards.spi=busio.SPI(board.SCL,board.SDA)tft_cs=board.D6tft_dc=board.D9tft_reset=board.D5display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=tft_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1322.SSD1322(display_bus,width=256,height=64,colstart=28)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1325 | IntroductionDisplayIO driver for grayscale OLEDs drive by SSD1325DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1325To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1325To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1325Usage Exampleimporttimeimportboardimportbusioimportdisplayioimportfourwireimportadafruit_ssd1325displayio.release_displays()# This pinout works on a Metro and may need to be altered for other boards.spi=busio.SPI(board.SCL,board.SDA)tft_cs=board.D9tft_dc=board.D8tft_reset=board.D7display_bus=fourwire.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=tft_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1325.SSD1325(display_bus,width=128,height=64)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1327 | IntroductionDisplayIO drivers for grayscale OLEDs driven by SSD1327DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1327To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1327To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1327Usage Exampleimportboardimportdisplayioimportadafruit_ssd1327importbusioimporttimedisplayio.release_displays()# This pinout works on a Metro and may need to be altered for other boards.spi=busio.SPI(board.SCL,board.SDA)tft_cs=board.D6tft_dc=board.D9tft_reset=board.D5display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=tft_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1327.SSD1327(display_bus,width=128,height=128)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1331 | Introductiondisplayio drivers for SSD1331 DisplaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportboardimportdisplayio# Starting in CircuitPython 9.x fourwire will be a seperate internal library# rather than a component of the displayio librarytry:fromfourwireimportFourWireexceptImportError:fromdisplayioimportFourWireimportterminaliofromadafruit_display_textimportlabelfromadafruit_ssd1331importSSD1331spi=board.SPI()tft_cs=board.D5tft_dc=board.D6displayio.release_displays()display_bus=FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=board.D9)display=SSD1331(display_bus,width=96,height=64)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(96,64,1)color_palette=displayio.Palette(1)color_palette[0]=0x00FF00# Bright Greenbg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)# Draw a smaller inner rectangleinner_bitmap=displayio.Bitmap(86,54,1)inner_palette=displayio.Palette(1)inner_palette[0]=0xAA0088# Purpleinner_sprite=displayio.TileGrid(inner_bitmap,pixel_shader=inner_palette,x=5,y=5)splash.append(inner_sprite)# Draw a labeltext="Hello World!"text_area=label.Label(terminalio.FONT,text=text,color=0xFFFF00,x=12,y=32)splash.append(text_area)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1351 | Introductiondisplayio Driver for SSD1351 DisplaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportboardimportdisplayiofromadafruit_ssd1351importSSD1351spi=board.SPI()tft_cs=board.D5tft_dc=board.D6displayio.release_displays()display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=board.D9)display=SSD1351(display_bus,width=128,height=128)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(128,128,1)color_palette=displayio.Palette(1)color_palette[0]=0xFF0000bg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1608 | IntroductionCircuitPythondisplayiodriver for SSD1608-based ePaper displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1608To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1608To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1608Usage Example"""Simple test script for 1.54" 200x200 monochrome display.
Supported products:
* Adafruit 1.54" Monochrome ePaper Display Breakout
* https://www.adafruit.com/product/4196
"""importtimeimportboardimportdisplayioimportfourwireimportadafruit_ssd1608displayio.release_displays()# This pinout works on a Feather M4 and may need to be altered for other boards.spi=board.SPI()# Uses SCK and MOSIepd_cs=board.D9epd_dc=board.D10epd_reset=board.D5epd_busy=board.D6display_bus=fourwire.FourWire(spi,command=epd_dc,chip_select=epd_cs,reset=epd_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1608.SSD1608(display_bus,width=200,height=200,busy_pin=epd_busy)g=displayio.Group()f=open("/display-ruler.bmp","rb")pic=displayio.OnDiskBitmap(f)# CircuitPython 6 & 7 compatiblet=displayio.TileGrid(pic,pixel_shader=getattr(pic,"pixel_shader",displayio.ColorConverter()))# CircuitPython 7 compatible only# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)g.append(t)display.root_group=gdisplay.refresh()print("refreshed")time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1675 | IntroductionCircuitPythondisplayiodrivers for SSD1675-based ePaper displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1675To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1675To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1675Usage Example"""Simple test script for 2.13" 250x122 black and white featherwing.
Supported products:
* Adafruit 2.13" Black and White FeatherWing
* https://www.adafruit.com/product/4195
"""importtimeimportboardimportbusioimportdisplayio# Starting in CircuitPython 9.x, fourwire will be a seperate internal library# rather than a component of the displayio librarytry:fromfourwireimportFourWireexceptImportError:fromdisplayioimportFourWireimportadafruit_ssd1675displayio.release_displays()epd_cs=board.D9epd_dc=board.D10display_bus=FourWire(board.SPI(),command=epd_dc,chip_select=epd_cs,baudrate=1000000)time.sleep(1)display=adafruit_ssd1675.SSD1675(display_bus,width=250,height=122,rotation=90)g=displayio.Group()f=open("/display-ruler.bmp","rb")pic=displayio.OnDiskBitmap(f)# CircuitPython 6 & 7 compatiblet=displayio.TileGrid(pic,pixel_shader=getattr(pic,"pixel_shader",displayio.ColorConverter()))# CircuitPython 7 compatible only# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)g.append(t)display.root_group=gdisplay.refresh()print("refreshed")time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1680 | IntroductionCircuitPythondisplayiodriver for SSD1680-based ePaper displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Adafruit 2.13” 250x122 Tri-Color eInk / ePaper Display with SRAM - SSD1680 DriverPurchase the Breakout from the Adafruit shopAdafruit 2.13” HD Tri-Color eInk / ePaper Display FeatherWing - 250x122 RW Panel with SSD1680Purchase the FeatherWing from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1680To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1680To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1680Usage Exampleimporttimeimportboardimportdisplayioimportfourwireimportadafruit_ssd1680displayio.release_displays()# This pinout works on a Metro M4 and may need to be altered for other boards.spi=board.SPI()# Uses SCK and MOSIepd_cs=board.D9epd_dc=board.D10epd_reset=board.D8# Set to None for FeatherWingepd_busy=board.D7# Set to None for FeatherWingdisplay_bus=fourwire.FourWire(spi,command=epd_dc,chip_select=epd_cs,reset=epd_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1680.SSD1680(display_bus,width=250,height=122,busy_pin=epd_busy,highlight_color=0xFF0000,rotation=270,)g=displayio.Group()# CircuitPython 6 & 7 compatiblef=open("/display-ruler.bmp","rb")pic=displayio.OnDiskBitmap(f)t=displayio.TileGrid(pic,pixel_shader=getattr(pic,"pixel_shader",displayio.ColorConverter()))# # CircuitPython 7 compatible only# pic = displayio.OnDiskBitmap("/display-ruler.bmp")# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)g.append(t)display.root_group=gdisplay.refresh()print("refreshed")time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-ssd1681 | IntroductionCircuitPythondisplayiodriver for SSD1681-based ePaper displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Adafruit 1.54” Tri-Color eInk / ePaper 200x200 Display with SRAMPurchase one from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-ssd1681To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ssd1681To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ssd1681Usage Exampleimporttimeimportboardimportdisplayioimportfourwireimportadafruit_ssd1681displayio.release_displays()# This pinout works on a Feather M4 and may need to be altered for other boards.spi=board.SPI()# Uses SCK and MOSIepd_cs=board.D9epd_dc=board.D10epd_reset=board.D5epd_busy=board.D6display_bus=fourwire.FourWire(spi,command=epd_dc,chip_select=epd_cs,reset=epd_reset,baudrate=1000000)time.sleep(1)display=adafruit_ssd1681.SSD1681(display_bus,width=200,height=200,busy_pin=epd_busy,rotation=180)g=displayio.Group()# CircuitPython 6 & 7 compatiblef=open("/display-ruler.bmp","rb")pic=displayio.OnDiskBitmap(f)t=displayio.TileGrid(pic,pixel_shader=getattr(pic,"pixel_shader",displayio.ColorConverter()))# # CircuitPython 7 compatible only# pic = displayio.OnDiskBitmap("/display-ruler.bmp")# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)g.append(t)display.root_group=gdisplay.refresh()print("refreshed")time.sleep(120)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-st7565 | IntroductionA display control library for ST7565 graphic displaysDependenciesThis driver depends on:Adafruit CircuitPythonBus DevicePlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage ExampleSee examples folder for demos of pixels, lines, and text!DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-st7735 | Introductiondisplayio driver for ST7735B TFT-LCD displays.HardwareThis driver does not work for any current Adafruit Displays. It is intended to be used with displays
with an ST7735B or similar chipset and was created using initialization codes from the Arduino Library.
If you have a newer Adafruit Display with a ST7735R or ST7735S chip,
please visitthe Adafruit ST7735R Driver.DependenciesThis driver depends on:Adafruit CircuitPython 4.0.0-beta.0+Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportboardimportdisplayiofromadafruit_st7735importST7735spi=board.SPI()tft_cs=board.D5tft_dc=board.D6displayio.release_displays()display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=board.D9)display=ST7735(display_bus,width=128,height=128)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(128,128,1)color_palette=displayio.Palette(1)color_palette[0]=0xFF0000bg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-st7735r | Introductiondisplayio driver for ST7735R TFT-LCD displays.Hardware1.8” SPI TFT display, 160x128 18-bit colorAdafruit 0.96” 160x80 Color TFT Display w/ MicroSD Card Breakout1.8” Color TFT LCD display with MicroSD Card BreakoutAdafruit 1.44” Color TFT LCD Display with MicroSD Card breakoutAdafruit Mini Color TFT with Joystick FeatherWingIf you have a board with a ST7735B chip, you may want to trythe Adafruit ST7735 Driver.DependenciesThis driver depends on:Adafruit CircuitPython 4.0.0-beta.0+Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportboardimportdisplayioimportfourwirefromadafruit_st7735rimportST7735Rspi=board.SPI()tft_cs=board.D5tft_dc=board.D6displayio.release_displays()display_bus=fourwire.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=board.D9)display=ST7735R(display_bus,width=128,height=128,colstart=2,rowstart=1)# Make the display contextsplash=displayio.Group()color_bitmap=displayio.Bitmap(128,128,1)color_palette=displayio.Palette(1)color_palette[0]=0xFF0000bg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
adafruit-circuitpython-st7789 | Introductiondisplayio driver for ST7789 TFT-LCD displays.DependenciesThis driver depends on:Adafruit CircuitPython 4.0.0-beta.0+Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Exampleimportboardimportdisplayio# Starting in CircuitPython 9.x fourwire will be a seperate internal library# rather than a component of the displayio librarytry:fromfourwireimportFourWireexceptImportError:fromdisplayioimportFourWirefromadafruit_st7789importST7789displayio.release_displays()spi=board.SPI()whilenotspi.try_lock():passspi.configure(baudrate=24000000)# Configure SPI for 24MHzspi.unlock()tft_cs=board.D5tft_dc=board.D6display_bus=FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=board.D9)display=ST7789(display_bus,width=240,height=240,rowstart=80)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(240,240,1)color_palette=displayio.Palette(1)color_palette[0]=0xFF0000bg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.