package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
adafruit-circuitpython-ducky
IntroductionCircuitPython library for running DuckyScriptDuckyScriptYou can find the DuckyScript DocumentationhereDependenciesThis 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-duckyTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-duckyTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-duckyInstalling 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_duckyOr the following command to update an existing version:circupupdateUsage ExampleHere is an example of using the Ducky library. First you will need to import the librariesimporttimeimportusb_hidfromadafruit_hid.keyboardimportKeyboardfromadafruit_hid.keyboard_layout_usimportKeyboardLayoutUSimportduckyOnce this is done, define the keyboard layout and initialize theDuckyobject.time.sleep(1)# Sleep for a bit to avoid a race condition on some systemskeyboard=Keyboard(usb_hid.devices)keyboard_layout=KeyboardLayoutUS(keyboard)# We're in the US :)duck=ducky.Ducky('duckyscript.txt',keyboard,keyboard_layout)Now, set up a loop which will run a line of the script every timeloopis called.result=TruewhileresultisnotFalse:result=duck.loop()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-dymoscale
IntroductionCircuitPython interface forDYMOpostage scales.NOTE: This library will not work on embedded linux, only on microcontrollers.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-dymoscaleTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-dymoscaleTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-dymoscaleUsage ExampleInitialize the scale by passing it a data pin and a pin to toggle the units button:# initialize the dymo scaleunits_pin=digitalio.DigitalInOut(board.D3)units_pin.switch_to_output()dymo=adafruit_dymoscale.DYMOScale(board.D4,units_pin)Get the item’s weight from the scale:reading=dymo.weightprint(reading.weight)Get the item’s units from the scale:print(reading.units)To toggle between units (simulate a button press):dymo.toggle_unit_button(switch_unit=True)To toggle the unit button, but preserve the unit displayed:dymo.toggle_unit_button()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-ek79686
IntroductionCircuitPythondisplayiodriver for EK79686-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.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-ek79686To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ek79686To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-ek79686Installing 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_ek79686Or the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportdisplayioimportadafruit_ek79686# Used to ensure the display is free in CircuitPythondisplayio.release_displays()# Define the pins needed for display use on the Metrospi=board.SPI()epd_cs=board.D10epd_dc=board.D9epd_reset=board.D5epd_busy=board.D6# Create the displayio connection to the display pinsdisplay_bus=displayio.FourWire(spi,command=epd_dc,chip_select=epd_cs,reset=epd_reset,baudrate=1000000)time.sleep(1)# Wait a bit# Create the display object - the third color is red (0xff0000)display=adafruit_ek79686.EK79686(display_bus,width=264,height=176,busy_pin=epd_busy,highlight_color=0xFF0000,rotation=90,)# Create a display group for our screen objectsg=displayio.Group()# Display a ruler graphic from the root directory of the CIRCUITPY drivewithopen("/display-ruler.bmp","rb")asf:pic=displayio.OnDiskBitmap(f)# Create a Tilegrid with the bitmap and put in the displayio group# 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)# Place the display group on the screen (does not refresh)display.show(g)# Show the image on the displaydisplay.refresh()print("refreshed")# Do Not refresh the screen more often than every 180 seconds# for eInk displays! Rapid refreshes will damage the panel.time.sleep(180)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-emc2101
IntroductionCircuitPython driver for EMC2101 brushless fan controllerDependenciesThis 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-emc2101To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-emc2101To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-emc2101Usage Exampleimporttimeimportboardfromadafruit_emc2101importEMC2101i2c=board.I2C()# uses board.SCL and board.SDAemc=EMC2101(i2c)print("Setting fan speed to 25%")emc.manual_fan_speed=25time.sleep(2)# longer sleep to let it spin down from 100%print("Fan speed",emc.fan_speed)Additional examples, including the use of the temperature look up table (LUT) can be found in the examples/ folder:emc2101_lut_example.pyemc2101_set_pwm_freq.pyemc2101_simpletest.pyFor access to some additional properties, but without configuring the LUT, use the intermediate class EMC2101_EXT:importtimeimportboardfromadafruit_emc2101importEMC2101_EXTi2c=board.I2C()# uses board.SCL and board.SDAemc=EMC2101_EXT(i2c)print("External limit temp is",emc.external_temp_high_limit)print("Setting external limit temp to 50C")emc.external_temp_high_limit=50When the temperature limits are exceeded the device sets the alert bit in the status register and (if configured to do so) will raise the ALERT output pin as an interrupt.EMC2101_EXT defines properties for internal and external temperature limits, and has register definitions for all registers except the LUT itself. The EMC2101_LUT class includes this as well.The EMC2101_Regs class is intended for internal use, and defines register addresses.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-ens160
IntroductionCircuitPython / Python library for ScioSense ENS160 digital multi-gas 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 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-ens160To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ens160To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-ens160Installing 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_ens160Or 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-epd
IntroductionThis library is for using CircuitPython with e-ink displays with built in SRAM.DependenciesThis driver depends on:Adafruit CircuitPythonBus Devicefont5x8.bin found in the examples bundlePlease 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-epdTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-epdTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-epdUsage Exampleimportdigitalioimportbusioimportboardfromadafruit_epd.epdimportAdafruit_EPDfromadafruit_epd.il0373importAdafruit_IL0373# create the spi device and pins we will needspi=busio.SPI(board.SCK,MOSI=board.MOSI,MISO=board.MISO)ecs=digitalio.DigitalInOut(board.D12)dc=digitalio.DigitalInOut(board.D11)srcs=digitalio.DigitalInOut(board.D10)# can be None to use internal memoryrst=digitalio.DigitalInOut(board.D9)# can be None to not use this pinbusy=digitalio.DigitalInOut(board.D5)# can be None to not use this pin# give them all to our driverprint("Creating display")display=Adafruit_IL0373(104,212,spi,# 2.13" Tri-color displaycs_pin=ecs,dc_pin=dc,sramcs_pin=srcs,rst_pin=rst,busy_pin=busy)display.rotation=1# clear the bufferprint("Clear buffer")display.fill(Adafruit_EPD.WHITE)display.pixel(10,100,Adafruit_EPD.BLACK)print("Draw Rectangles")display.fill_rect(5,5,10,10,Adafruit_EPD.RED)display.rect(0,0,20,30,Adafruit_EPD.BLACK)print("Draw lines")display.line(0,0,display.width-1,display.height-1,Adafruit_EPD.BLACK)display.line(0,display.height-1,display.width-1,0,Adafruit_EPD.RED)print("Draw text")display.text('hello world',25,10,Adafruit_EPD.BLACK)display.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-esp32s2tft
IntroductionHelper library for the Adafruit ESP32-S2 TFT Feather.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.Adafruit ESP32-S2 TFT FeatherPurchase one from the Adafruit shopInstalling 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_esp32s2tftOr the following command to update an existing version:circupupdateUsage Exampleimportrandomfromrainbowioimportcolorwheelfromadafruit_esp32s2tftimportESP32S2TFTesp32s2tft=ESP32S2TFT(default_bg=0xFFFF00,scale=2,)# Create the labelsesp32s2tft.add_text(text="ESP32-S2",text_position=(10,10),text_scale=2,text_color=0xFF00FF)esp32s2tft.add_text(text="TFT Feather",text_position=(60,30),text_anchor_point=(0.5,0.5),text_color=0xFF00FF,)button_label=esp32s2tft.add_text(text="Press BOOT0 Button",line_spacing=1.0,text_position=(60,50),text_anchor_point=(0.5,0.5),text_color=0x606060,)esp32s2tft.display.root_group=esp32s2tft.splashwhileTrue:esp32s2tft.set_text_color(0xFF0000ifesp32s2tft.peripherals.buttonelse0x606060,button_label)esp32s2tft.peripherals.led=esp32s2tft.peripherals.buttonifesp32s2tft.peripherals.button:esp32s2tft.peripherals.neopixel[0]=colorwheel(random.randint(0,255))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-esp32spi
IntroductionCircuitPython driver library for using ESP32 as WiFi co-processor using SPI. The companion firmwareis available on GitHub. Please be sure to check the example code for any specific firmware version dependencies that may exist.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceAdafruit CircuitPython ConnectionManagerPlease 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-esp32spiTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-esp32spiTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-esp32spiUsage ExampleCheck the examples folder for various demos for connecting and fetching data!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-esp-atcontrol
IntroductionThis library is no longer supported! The library is being left available for continued usage, however, Adafruit is no longer supporting it.Use the ESP AT command sent to communicate with the Interwebs. Its slow, but works to get data into CircuitPythonCommand set:https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdfExamples:https://www.espressif.com/sites/default/files/documentation/4b-esp8266_at_command_examples_en.pdfDependenciesThis 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-esp-atcontrolTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-esp-atcontrolTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-esp-atcontrolUsage ExampleSee examples folder for full demosDocumentationAPI 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-fakerequests
IntroductionFake Network Requests helper that retrieves data from a local file.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-fakerequestsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fakerequestsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fakerequestsUsage Examplefromadafruit_fakerequestsimportFake_Requestsresponse=Fake_Requests("local.txt")print(response.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-fancyled
IntroductionFancyLED is a CircuitPython library to assist in creating buttery smooth LED animation. It’s loosely inspired by the FastLED library for Arduino, and in fact we have a “helper” library using similar function names to assist with porting of existing Arduino FastLED projects to 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-fancyledTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fancyledTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fancyledUsage ExampleSee the 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-featherwing
IntroductionThis library provides FeatherWing specific classes for those that require a significant amount of initialization.DependenciesThese drivers depends on:Adafruit CircuitPythonINA219SeesawHT16K33DotStarNeoPixelDS3231ST7735RADXL34xADT7410Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloadingthe Adafruit library and driver bundleand highly recommended over installing each one.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-featherwingTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-featherwingTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-featherwingDocumentationAPI 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-fingerprint
IntroductionThis library will let you use an Adafruit Fingerprint sensor on any UART to get, store, retreive and query fingerprints! Great for adding bio-sensing security to your next build.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-fingerprintTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fingerprintTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fingerprintUsage ExampleSee ‘examples’ folder for full usage demo!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-floppy
IntroductionInterface with archaic spinning rustDependenciesThis driver depends on:Adafruit CircuitPythonAdafruit TicksPlease 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:circupinstalladafruit_floppyOr the following command to update an existing version:circupupdateUsage ExampleSee theExamples pagefor a full example. This example shows how to initialize a floppy and seek to track 1, but it omits the pin arguments to the Floppy constructor for brevity:importboardimportadafruit_floppyfloppy=adafruit_floppy.MFMFloppy(...)floppy.selected=Truefloppy.spin=Truefloppy.track=1ContributingContributions 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-focaltouch
IntroductionCircuitPython driver for common low-cost FocalTech capacitive touch chips. Currently supports FT6206 & FT6236DependenciesThis 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-focaltouchTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-focaltouchTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-focaltouchUsage Exampleimporttimeimportboardimportbusioimportadafruit_focaltouch# Create library object (named "ft") using a Bus I2C porti2c=busio.I2C(board.SCL,board.SDA)ft=adafruit_focaltouch.Adafruit_FocalTouch(i2c,debug=False)whileTrue:# if the screen is being touched print the touchesifft.touched:print(ft.touches)else:print('no touch')time.sleep(.15)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-fona
IntroductionCircuitPython library for theAdafruit FONAcellular module.DependenciesThis driver depends on:Adafruit CircuitPythonSimpleIOPlease 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-fonaTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fonaTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fonaUsage ExamplePlease see the examples directory for code 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-fram
IntroductionCircuitPython/Python library to support the I2C and SPI FRAM Breakouts.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-framTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-framTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-framUsage ExampleSee simpletest examples in 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-framebuf
IntroductionCircuitPython framebuf module, based on the Python framebuf module.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-framebufTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-framebufTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-framebufUsage ExampleSee example in /examples/framebuf_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-ft5336
IntroductionCircuitPython driver for the FT5336 touch controllerDependenciesThis 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-ft5336To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ft5336To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-ft5336Installing 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_ft5336Or the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportadafruit_ft5336i2c=board.I2C()touch=adafruit_ft5336.Adafruit_FT5336(i2c)whileTrue:t=touch.pointsprint(t)time.sleep(0.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-funhouse
IntroductionHelper library for the Adafruit FunHouse boardDependenciesThis 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 FunHouse Home Automation boardPurchase one from the Adafruit shopUsage ExampleimportboardfromdigitalioimportDigitalInOut,Direction,Pullimportadafruit_dps310importadafruit_ahtx0fromadafruit_funhouseimportFunHousefunhouse=FunHouse(default_bg=0x0F0F00,scale=2,)i2c=board.I2C()dps310=adafruit_dps310.DPS310(i2c)aht20=adafruit_ahtx0.AHTx0(i2c)funhouse.peripherals.set_dotstars(0x800000,0x808000,0x008000,0x000080,0x800080)# sensor setupsensors=[]forpin(board.A0,board.A1,board.A2):sensor=DigitalInOut(p)sensor.direction=Direction.INPUTsensor.pull=Pull.DOWNsensors.append(sensor)defset_label_color(conditional,index,on_color):ifconditional:funhouse.set_text_color(on_color,index)else:funhouse.set_text_color(0x606060,index)# Create the labelsfunhouse.display.root_group=Noneslider_label=funhouse.add_text(text="Slider:",text_position=(50,30),text_color=0x606060)capright_label=funhouse.add_text(text="Touch",text_position=(85,10),text_color=0x606060)pir_label=funhouse.add_text(text="PIR",text_position=(60,10),text_color=0x606060)capleft_label=funhouse.add_text(text="Touch",text_position=(25,10),text_color=0x606060)onoff_label=funhouse.add_text(text="OFF",text_position=(10,25),text_color=0x606060)up_label=funhouse.add_text(text="UP",text_position=(10,10),text_color=0x606060)sel_label=funhouse.add_text(text="SEL",text_position=(10,60),text_color=0x606060)down_label=funhouse.add_text(text="DOWN",text_position=(10,100),text_color=0x606060)jst1_label=funhouse.add_text(text="SENSOR 1",text_position=(40,80),text_color=0x606060)jst2_label=funhouse.add_text(text="SENSOR 2",text_position=(40,95),text_color=0x606060)jst3_label=funhouse.add_text(text="SENSOR 3",text_position=(40,110),text_color=0x606060)temp_label=funhouse.add_text(text="Temp:",text_position=(50,45),text_color=0xFF00FF)pres_label=funhouse.add_text(text="Pres:",text_position=(50,60),text_color=0xFF00FF)funhouse.display.root_group=funhouse.splashwhileTrue:funhouse.set_text("Temp%0.1F"%dps310.temperature,temp_label)funhouse.set_text("Pres%d"%dps310.pressure,pres_label)print(aht20.temperature,aht20.relative_humidity)set_label_color(funhouse.peripherals.captouch6,onoff_label,0x00FF00)set_label_color(funhouse.peripherals.captouch7,capleft_label,0x00FF00)set_label_color(funhouse.peripherals.captouch8,capright_label,0x00FF00)slider=funhouse.peripherals.sliderifsliderisnotNone:funhouse.peripherals.dotstars.brightness=sliderfunhouse.set_text("Slider:%1.1f"%slider,slider_label)set_label_color(sliderisnotNone,slider_label,0xFFFF00)set_label_color(funhouse.peripherals.button_up,up_label,0xFF0000)set_label_color(funhouse.peripherals.button_sel,sel_label,0xFFFF00)set_label_color(funhouse.peripherals.button_down,down_label,0x00FF00)set_label_color(funhouse.peripherals.pir_sensor,pir_label,0xFF0000)set_label_color(sensors[0].value,jst1_label,0xFFFFFF)set_label_color(sensors[1].value,jst2_label,0xFFFFFF)set_label_color(sensors[2].value,jst3_label,0xFFFFFF)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-fxas21002c
IntroductionCircuitPython module for the NXP FXAS21002C gyroscope.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-fxas21002cTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fxas21002cTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fxas21002cUsage Exampleimporttimeimportboardimportadafruit_fxas21002ci2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_fxas21002c.FXAS21002C(i2c)whileTrue:gyro_x,gyro_y,gyro_z=sensor.gyroscopeprint('Gyroscope (radians/s): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(gyro_x,gyro_y,gyro_z))time.sleep(1.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-fxos8700
IntroductionCircuitPython module for the NXP FXOS8700 accelerometer and 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-fxos8700To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-fxos8700To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-fxos8700Usage Exampleimporttimeimportboardimportadafruit_fxos8700i2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_fxos8700.FXOS8700(i2c)whileTrue:accel_x,accel_y,accel_z=sensor.accelerometermag_x,mag_y,mag_z=sensor.magnetometerprint('Acceleration (m/s^2): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(accel_x,accel_y,accel_z))print('Magnetometer (uTesla): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(mag_x,mag_y,mag_z))time.sleep(1.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-gc-iot-core
IntroductionGoogle Cloud IoT Core Client for CircuitPythonDependenciesThis driver depends on:Adafruit CircuitPythonAdafruit CircuitPython JWTAdafruit CircuitPython LoggingPlease 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-gc-iot-coreTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-gc-iot-coreTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-gc-iot-coreUsage ExampleUsage example within 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.LicenseThis library was written by Google for MicroPython. We’ve converted it to work with CircuitPython and made changes so it works with boards supported by CircuitPython and the CircuitPython API.We’ve added examples for using this library to transmit board telemetry data along with sensor data to Google’s Cloud Platform.This open source code is licensed under the Apache license (see LICENSE) for details.
adafruit-circuitpython-gfx
IntroductionCircuitPython pixel graphics drawing library.Important: This library will likely be deprecated soon. If you are looking to use a specific display, search the product name (i.e. ssd1322 or ili9341) athttps://github.com/adafruit/, or find it in thecircuitpython bundle.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.Usage ExampleSee example in /examples/gfx_simpletest.pyMost displays now use displayio. You can find simpletests for specific displays in their respective repositories or in the examples section of thecircuitpython bundleContributingContributions 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-gizmo
IntroductionCircuitPython classes for Adafruit GizmosDependenciesThis 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.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-gps
IntroductionGPS parsing module. Can send commands to, and parse simple NMEA data sentences from serial and I2C GPS modules to read latitude, longitude, and more.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-gpsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-gpsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-gpsUsage ExampleSee examples/gps_simpletest.py for a demonstration of parsing and printing GPS location.Important: Feather boards and many other circuitpython boards will round to two decimal places like this:>>>float('1234.5678')1234.57This isn’t ideal for GPS data as this lowers the accuracy from 0.1m to 11m.This can be fixed by using string formatting when the GPS data is output.An implementation of this can be found in examples/gps_simpletest.pyimporttimeimportboardimportbusioimportadafruit_gpsRX=board.RXTX=board.TXuart=busio.UART(TX,RX,baudrate=9600,timeout=30)gps=adafruit_gps.GPS(uart,debug=False)gps.send_command(b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0')gps.send_command(b'PMTK220,1000')last_print=time.monotonic()whileTrue:gps.update()current=time.monotonic()ifcurrent-last_print>=1.0:last_print=currentifnotgps.has_fix:print('Waiting for fix...')continueprint('='*40)# Print a separator line.print('Latitude:{0:.6f}degrees'.format(gps.latitude))print('Longitude:{0:.6f}degrees'.format(gps.longitude))These two lines are the lines that actually solve the issue:print('Latitude:{0:.6f}degrees'.format(gps.latitude))print('Longitude:{0:.6f}degrees'.format(gps.longitude))Note: Sending multiple PMTK314 packets withgps.send_command()will not work unless there is a substantial amount of time in-between each timegps.send_command()is called. Atime.sleep()of 1 second or more should fix this.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-guvx-i2c
IntroductionPython drivers for the GUVA-C32SM and GUVB-C31SM I2C UV sensorsDependenciesThis 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.Works with the GUVx family of I2C UV light sensorsPurchase 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-guvx-i2cTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-guvx-i2cTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-guvx-i2cInstalling 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_guvx_i2cOr 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-hashlib
IntroductionThis module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321).The SHA1 algorithm is not supported by the CircuitPython module.This library is based on the work performed in the micropython-lib hashlib module by Paul SokolovskyDependenciesThis 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-hashlibTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-hashlibTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-hashlibUsage Exampleimportadafruit_hashlibashashlibm=hashlib.sha256()m.update(b"CircuitPython")print("Msg Hex Digest:{}\nMsg Digest Size:{}\nMsg Block Size:{}".format(m.hexdigest(),m.digest_size,m.block_size))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-hcsr04
IntroductionThe HC-SR04 is an inexpensive solution for measuring distances using microcontrollers. This library provides a simple driver for controlling these sensors from 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-hcsr04To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-hcsr04To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-hcsr04Usage ExampleWarningThe HC-SR04 uses 5V logic, so you will have to use alevel shifterbetween it and your CircuitPython board (which uses 3.3V logic).NoteIf you want to use an HC-SR04 withMicroPython, I recommend checking outthis library.You’ll need to dedicate two pins to communicating with the HC-SR04. The sensor communicates in a very rudimentary manner, so it doesn’t matter which pins you choose, as long as they’re digital IO pins (pins that start with “D” are digital).There are two ways of instantiating aHCSR04object: with or without using a context manager.NoteIt is technically possible to communicate with the HC-SR04 using only one wire since the trigger and echo signals aren’t ever active at the same time. Once I have a chance to determine a safe way to do this, I plan to add this as a feature to the library.See Also:Adafruit’s guide on Lifetime and ContextManagersGives more info on using context managers with CircuitPython drivers.boardA list of pins available on your device. To view this list, firstget a REPL(the guide linked was written for the pyboard, but it still works), then input the following:importboarddir(board)Without a Context ManagerIn the example below, we create theHCSR04object directly, get the distance every 2 seconds.importtimeimportboardimportadafruit_hcsr04sonar=adafruit_hcsr04.HCSR04(trigger_pin=board.D5,echo_pin=board.D6)whileTrue:try:print((sonar.distance,))exceptRuntimeError:print("Retrying!")time.sleep(2)With a Context ManagerIn the example below, we use a context manager (thewithstatement) to create theHCSR04instance, again get the distance every 2 seconds, but then the context manager handles de-initializing the device for us.importboardfromadafruit_hcsr04importHCSR04withHCSR04(trigger_pin=board.D5,echo_pin=board.D6)assonar:try:whileTrue:print(sonar.distance)sleep(2)exceptKeyboardInterrupt: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-hid
IntroductionThis driver simulates USB HID devices. Currently keyboard and mouse are implemented.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.Additional LayoutsThis library has an en-US layout. Please check out and expandthe library from Neradocfor additional layouts.Usage ExampleTheKeyboardclass sends keypress reports for a USB keyboard device to the host.TheKeycodeclass defines USB HID keycodes to send usingKeyboard.importusb_hidfromadafruit_hid.keyboardimportKeyboardfromadafruit_hid.keycodeimportKeycode# Set up a keyboard device.kbd=Keyboard(usb_hid.devices)# Type lowercase 'a'. Presses the 'a' key and releases it.kbd.send(Keycode.A)# Type capital 'A'.kbd.send(Keycode.SHIFT,Keycode.A)# Type control-x.kbd.send(Keycode.CONTROL,Keycode.X)# You can also control press and release actions separately.kbd.press(Keycode.CONTROL,Keycode.X)kbd.release_all()# Press and hold the shifted '1' key to get '!' (exclamation mark).kbd.press(Keycode.SHIFT,Keycode.ONE)# Release the ONE key and send another report.kbd.release(Keycode.ONE)# Press shifted '2' to get '@'.kbd.press(Keycode.TWO)# Release all keys.kbd.release_all()TheKeyboardLayoutUSsends ASCII characters using keypresses. It assumes the host is set to accept keypresses from a US keyboard.If the host is expecting a non-US keyboard, the character to key mapping provided byKeyboardLayoutUSwill not always be correct. Different keypresses will be needed in some cases. For instance, to type an'A'on a French keyboard (AZERTY instead of QWERTY),Keycode.Qshould be pressed.Currently this package provides onlyKeyboardLayoutUS. MoreKeyboardLayoutclasses could be added to handle non-US keyboards and the different input methods provided by various operating systems.importusb_hidfromadafruit_hid.keyboardimportKeyboardfromadafruit_hid.keyboard_layout_usimportKeyboardLayoutUSkbd=Keyboard(usb_hid.devices)layout=KeyboardLayoutUS(kbd)# Type 'abc' followed by Enter (a newline).layout.write('abc\n')# Get the keycodes needed to type a '$'.# The method will return (Keycode.SHIFT, Keycode.FOUR).keycodes=layout.keycodes('$')TheMouseclass simulates a three-button mouse with a scroll wheel.importusb_hidfromadafruit_hid.mouseimportMousem=Mouse(usb_hid.devices)# Click the left mouse button.m.click(Mouse.LEFT_BUTTON)# Move the mouse diagonally to the upper left.m.move(-100,-100,0)# Roll the mouse wheel away from the user one unit.# Amount scrolled depends on the host.m.move(0,0,-1)# Keyword arguments may also be used. Omitted arguments default to 0.m.move(x=-100,y=-100)m.move(wheel=-1)# Move the mouse while holding down the left button. (click-drag).m.press(Mouse.LEFT_BUTTON)m.move(x=50,y=20)m.release_all()# or m.release(Mouse.LEFT_BUTTON)TheConsumerControlclass emulates consumer control devices such as remote controls, or the multimedia keys on certain keyboards.importusb_hidfromadafruit_hid.consumer_controlimportConsumerControlfromadafruit_hid.consumer_control_codeimportConsumerControlCodecc=ConsumerControl(usb_hid.devices)# Raise volume.cc.send(ConsumerControlCode.VOLUME_INCREMENT)# Pause or resume playback.cc.send(ConsumerControlCode.PLAY_PAUSE)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-ht16k33
IntroductionThis is a library for using the I²C-based LED matrices with the HT16K33 chip. It supports both 16x8 and 8x8 matrices, as well as 7- and 14-segment displays.NotesThis library is intended for Adafruit CircuitPython’s API. For a library compatible with MicroPython machine API see thislibrary.This library does not work with the Trellis 4x4 LED+Keypad board. For that product use:CircuitPython Trellis LibraryDependenciesThis 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-ht16k33To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ht16k33To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ht16k33Usage Example# Import all board pins and bus interface.importboardimportbusio# Import the HT16K33 LED matrix module.fromadafruit_ht16k33importmatrix# Create the I2C interface.i2c=busio.I2C(board.SCL,board.SDA)# Create the matrix class.# This creates a 16x8 matrix:matrix=matrix.Matrix16x8(i2c)# Or this creates a 8x8 matrix:#matrix = matrix.Matrix8x8(i2c)# Or this creates a 8x8 bicolor matrix:#matrix = matrix.Matrix8x8x2# Finally you can optionally specify a custom I2C address of the HT16k33 like:#matrix = matrix.Matrix16x8(i2c, address=0x70)# Clear the matrix.matrix.fill(0)# Set a pixel in the origin 0,0 position.matrix[0,0]=1# Set a pixel in the middle 8, 4 position.matrix[8,4]=1# Set a pixel in the opposite 15, 7 position.matrix[15,7]=1matrix.show()# Change the brightnessmatrix.brightness=8# Set the blink ratematrix.blink_rate=2DocumentationAPI 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-hts221
IntroductionHelper library for the HTS221 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-hts221To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-hts221To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-hts221Usage Exampleimporttimeimportboardimportadafruit_hts221i2c=board.I2C()hts=adafruit_hts221.HTS221(i2c)whileTrue:print("Relative Humidity:%.2fpercent rH"%hts.relative_humidity)print("Temperature:%.2fC"%hts.temperature)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-httpserver
IntroductionHTTP Server for CircuitPython.Supportssocketpoolorsocketas a source of sockets; can be used in CPython.HTTP 1.1.Serves files from a designated root.Routing for serving computed responses from handlers.Gives access to request headers, query parameters, form data, body and client’s address (the one from which the request came).Supports chunked transfer encoding.Supports URL parameters and wildcard URLs.Supports HTTP Basic and Bearer Authentication on both server and route per level.Supports Websockets and Server-Sent Events.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-httpserverTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-httpserverTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-httpserverInstalling 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_httpserverOr the following command to update an existing version:circupupdateSecurityThe HTTP server implementation in this package is not robust and should only be deployed on trusted networks. For instance, there are trivial denial of service attacks against adafruit_httpserver. Pull requests that improve the server’s security and robustness are of course welcome.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.
adafruit-circuitpython-HTU21D
IntroductionThis driver enables you to use the Adafruit HTU21D-F temperature and humidity breakout with CircuitPyton.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-htu21dTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-htu21dTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-htu21dUsage Exampleimporttimeimportboardfromadafruit_htu21dimportHTU21D# Create sensor object, communicating over the board's default I2C busi2c=board.I2C()# uses board.SCL and board.SDAsensor=HTU21D(i2c)whileTrue:print("\nTemperature:%0.1fC"%sensor.temperature)print("Humidity:%0.1f%%"%sensor.relative_humidity)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-htu31d
IntroductionPython library for TE HTU31D 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-htu31dTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-htu31dTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-htu31dUsage Exampleimporttimeimportboardimportadafruit_htu31di2c=board.I2C()# uses board.SCL and board.SDAhtu=adafruit_htu31d.HTU31D(i2c)print("Found HTU31D with serial number",hex(htu.serial_number))htu.heater=Trueprint("Heater is on?",htu.heater)htu.heater=Falseprint("Heater is on?",htu.heater)whileTrue:temperature,relative_humidity=htu.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-hue
IntroductionCircuitPython helper library for Philips Hue Lights.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit CircuitPython SimpleIOAdafruit CircuitPython ESP32SPIPlease 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-hueTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-hueTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-hueUsage ExampleLoad bridge username and IP Address from secrets.py file:username=secrets['hue_username']bridge_ip=secrets['bridge_ip']my_bridge=Bridge(wifi,bridge_ip,username)Enumerate all lights on the bridgelights=my_bridge.get_lights()Turn on a lightmy_bridge.set_light(1,on=True)Turn off a lightmy_bridge.set_light(1,on=False)Set a light to the color yellow (RGB)color=my_bridge.rgb_to_hsb([255,255,0])my_bridge.set_light(1,hue=int(color[0]),sat=int(color[1]),bri=int(color[2]))Set a group of lights to a predefined scenemy_bridge.set_group(1,scene='AB34EF5')Set a group of lights to a predefined colormy_bridge.set_group(1,color)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-husb238
IntroductionCircuitPython helper library for the HUSB238 Type C Power Delivery Dummy BreakoutDependenciesThis 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.The HUSB238 USB PD sink chip is neat in that you can either use jumpers (really, resistor selection) to set the desired power delivery voltage and current or you can use I2C for dynamic querying and setting.We’ve built a nice Adafruit USB Type C Power Delivery Dummy Breakout board around the HUSB238 to make it very easy to configure and integrate without having to solder any tiny resistors.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-husb238To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-husb238To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-husb238Installing 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_husb238Or the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportadafruit_husb238i2c=board.I2C()# Initialize HUSB238pd=adafruit_husb238.Adafruit_HUSB238(i2c)voltages=pd.available_voltages()v=0whileTrue:ifpd.is_attached():print(f"Setting to{voltages[v]}V!")pd.value=voltages[v]pd.set_value()current=pd.read_current()volts=pd.read_voltage()response=pd.get_response()print(f"The PD chip returned a response of:{response}")print(f"It is set to{volts}V/{current}")print()v=(v+1)%len(voltages)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-hx8357
Introductiondisplayio Driver for HX8357 Displays such as the 3.5-inch TFT FeatherWing and BreakoutDependenciesThis 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_hx8357importHX8357spi=board.SPI()tft_cs=board.D9tft_dc=board.D10displayio.release_displays()display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs)display=HX8357(display_bus,width=480,height=320)# Make the display contextsplash=displayio.Group()display.show(splash)color_bitmap=displayio.Bitmap(480,320,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-icm20649
IntroductionLibrary for the ST ICM-20649 Wide-Range 6-DoF Accelerometer and GyroDependenciesThis 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-icm20649To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-icm20649To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-icm20649Usage ExampleContributingContributions 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-icm20x
IntroductionLibrary for the ST ICM-20X Wide-Range 6-DoF Accelerometer and Gyro FamilyDependenciesThis 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-icm20xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-icm20xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-icm20xUsage ExampleFor use with the ICM20649:importtimeimportboardimportadafruit_icm20xi2c=board.I2C()# uses board.SCL and board.SDAicm=adafruit_icm20x.ICM20649(i2c)whileTrue:print("Acceleration: X:%.2f, Y:%.2f, Z:%.2fm/s^2"%(icm.acceleration))print("Gyro X:%.2f, Y:%.2f, Z:%.2frads/s"%(icm.gyro))print("")time.sleep(0.5)For use with the ICM20948:importtimeimportboardimportadafruit_icm20xi2c=board.I2C()# uses board.SCL and board.SDAicm=adafruit_icm20x.ICM20948(i2c)whileTrue:print("Acceleration: X:%.2f, Y:%.2f, Z:%.2fm/s^2"%(icm.acceleration))print("Gyro X:%.2f, Y:%.2f, Z:%.2frads/s"%(icm.gyro))print("Magnetometer X:%.2f, Y:%.2f, Z:%.2fuT"%(icm.magnetic))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-il0373
IntroductionCircuitPythondisplayiodriver for IL0373-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-il0373To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-il0373To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-il0373Usage 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-il0398
IntroductionCircuitPython displayio drivers for IL0398 driven e-paper 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-il0398To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-il0398To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-il0398Usage Example"""Simple test script for 4.2" 400x300 black and white displays. Supported products: * WaveShare 4.2" Black and White * https://www.waveshare.com/product/modules/oleds-lcds/e-paper/4.2inch-e-paper.htm * https://www.waveshare.com/product/modules/oleds-lcds/e-paper/4.2inch-e-paper-module.htm """importtimeimportboardimportdisplayioimportfourwireimportadafruit_il0398displayio.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_il0398.IL0398(display_bus,width=400,height=300,seconds_per_frame=20,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()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-il91874
IntroductionCircuitPythondisplayiodriver for IL91874-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-il91874To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-il91874To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-il91874Usage Example"""Simple test script for 2.7" 264x176 Tri-Color display shield Supported products: * Adafruit 2.7" Tri-Color ePaper Display Shield * https://www.adafruit.com/product/4229 """importtimeimportboardimportbusioimportdisplayioimportadafruit_il91874displayio.release_displays()spi=board.SPI()epd_cs=board.D10epd_dc=board.D9display_bus=displayio.FourWire(spi,command=epd_dc,chip_select=epd_cs,baudrate=1000000)time.sleep(1)display=adafruit_il91874.IL91874(display_bus,width=264,height=176,highlight_color=0xff0000,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-ili9341
Introductiondisplayio driver for ILI9341 and ILI9340 TFT-LCD displays.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.Usage Exampleimportboardimportdisplayioimportfourwireimportadafruit_ili9341spi=board.SPI()tft_cs=board.D9tft_dc=board.D10displayio.release_displays()display_bus=fourwire.FourWire(spi,command=tft_dc,chip_select=tft_cs)display=adafruit_ili9341.ILI9341(display_bus,width=320,height=240)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(320,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.
adafruit-circuitpython-imageload
IntroductionThis library decodes an image file into new bitmap and palette objects of the provided type. It’s designed to load code needed during decoding as needed. This is meant to minimize the memory overhead of the decoding code.Only certain types of bitmaps work with this library, and they often have to be exported in specific ways. To find out what types are supported and how to make them, seethis learn guide page.Usage Exampleimportboardimportdisplayioimportadafruit_imageloadimage,palette=adafruit_imageload.load("images/4bit.bmp",bitmap=displayio.Bitmap,palette=displayio.Palette)tile_grid=displayio.TileGrid(image,pixel_shader=palette)group=displayio.Group()group.append(tile_grid)board.DISPLAY.root_group=groupwhileTrue: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-ina219
IntroductionCircuitPython driver for theINA219 current sensor.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-ina219To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ina219To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ina219Usage ExampleseeexampleDocumentationAPI 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-ina260
IntroductionCircuitPython driver for the TI INA260 current and power 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 PyPINoteThis library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability! If the library is not planned for PyPI, remove the entire ‘Installing from PyPI’ section. On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom PyPI. To install for current user:pip3installadafruit-circuitpython-ina260To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ina260To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ina260Usage Exampleimport time import board import adafruit_ina260 i2c = board.I2C() ina260 = adafruit_ina260.INA260(i2c) while True: print("Current: %.2f Voltage: %.2f Power:%.2f" %(ina260.current, ina260.voltage, ina260.power)) 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-irremote
IntroductionCircuitPython driver for use with IR Receivers.Examples of products to use this library with:Circuit Playground ExpressIR Receiver 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-irremoteTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-irremoteTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-irremoteUsage Example# Circuit Playground Express Demo Code# Adjust the pulseio 'board.PIN' if using something elseimportpulseioimportboardimportadafruit_irremotepulsein=pulseio.PulseIn(board.REMOTEIN,maxlen=120,idle_state=True)decoder=adafruit_irremote.GenericDecode()whileTrue:pulses=decoder.read_pulses(pulsein)print("Heard",len(pulses),"Pulses:",pulses)try:code=decoder.decode_bits(pulses)print("Decoded:",code)exceptadafruit_irremote.IRNECRepeatException:# unusual short code!print("NEC repeat!")exceptadafruit_irremote.IRDecodeExceptionase:# failed to decodeprint("Failed to decode: ",e.args)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-is31fl3731
IntroductionCircuitPython driver for the IS31FL3731 charlieplex IC.This driver supports the following hardware:Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731Adafruit 15x7 CharliePlex LED Matrix Display FeatherWingsAdafruit 16x8 CharliePlex LED Matrix BonnetsPimoroni 17x7 Scroll pHAT HDPimoroni 28x3 (r,g,b) Led ShimPimoroni Keybow 2040 with 4x4 matrix of RGB LEDsPimoroni 5x5 RGB Matrix BreakoutDependenciesThis 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-is31fl3731To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-is31fl3731To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-is31fl3731Usage ExampleMatrix:fromadafruit_is31fl3731.matriximportMatriximportboardimportbusiowithbusio.I2C(board.SCL,board.SDA)asi2c:display=Matrix(i2c)display.fill(127)Charlie Wing:fromadafruit_is31fl3731.charlie_wingimportCharlieWingimportboardimportbusiowithbusio.I2C(board.SCL,board.SDA)asi2c:display=CharlieWing(i2c)display.fill(127)# Turn off pixel 4,4, change its brightness and turn it back ondisplay.pixel(4,4,0)# Turn off.display.pixel(4,4,50)# Low brightness (50)display.pixel(4,4,192)# Higher brightness (192)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-is31fl3741
IntroductionCircuitPython driver for the IS31FL3741 RGB Matrix IC.This driver supports the following hardware: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-is31fl3741To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-is31fl3741To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-is31fl3741Usage ExampleMatrix:fromadafruit_is31fl3741.matriximportMatriximportboardimportbusiowithbusio.I2C(board.SCL,board.SDA)asi2c:display=Matrix(i2c)display.fill(127)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-itertools
IntroductionPython’s itertools for CircuitPythonDependenciesThis 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 Exampleimporttimeimportboardimportbusioimportadafruit_si7021fromadafruit_itertools.adafruit_itertoolsimportcountfromadafruit_itertools.adafruit_itertools_extrasimportrepeatfunci2c=busio.I2C(board.SCL,board.SDA)sensor=adafruit_si7021.SI7021(i2c)defread_temperature():returnsensor.temperaturedefnow():returntime.monotonic()datapoints=zip(count(1),repeatfunc(now),map(int,repeatfunc(read_temperature)))whileTrue:print(next(datapoints))time.sleep(20.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-json-stream
IntroductionThis library is a reimplementation and subset ofjson_stream. It enables reading JSON data from a stream rather that loading it all into memory at once. The interface works like lists and dictionaries that are usually returned fromjson.load()but require in-order access. Out of order accesses will lead to missing keys and list entries.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 PyPIThis library is on PyPI for editors that use it for CircuitPython. In CPython, it is recommended to usejson_streamitself.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_json_streamOr the following command to update an existing version:circupupdateUsage Exampleimportsslimporttimeimportadafruit_requestsimportsocketpoolimportwifiimportadafruit_json_streamasjson_streampool=socketpool.SocketPool(wifi.radio)session=adafruit_requests.Session(pool,ssl.create_default_context())SCORE_URL="http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard"whileTrue:resp=session.get(SCORE_URL)json_data=json_stream.load(resp.iter_content(32))foreventinjson_data["events"]:if"Seattle"notinevent["name"]:continueforcompetitioninevent["competitions"]:forcompetitorincompetition["competitors"]:print(competitor["team"]["displayName"],competitor["score"])resp.close()time.sleep(60)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-jwt
IntroductionJSON Web Token (JWT) Authentication module for CircuitPython. JSON Web Tokens are an open, industry standardRFC 7519method for representing claims securely between two parties.This library currently supports the following signature algorithms for JWT generation and verification:No encoding (“none”)RS256/SHA-256 (viaAdafruit_CircuitPython_RSA)RS384/SHA-384 (viaAdafruit_CircuitPython_RSA)RS512/SHA-512 (viaAdafruit_CircuitPython_RSA)DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit_CircuitPython_RSAAdafruit_CircuitPython_binasciiPlease 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-jwtTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-jwtTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-jwtUsage ExampleGenerating encoded JWTimportadafruit_jwt# Import Private RSA key from a secrets.py filetry:fromsecretsimportsecretsexceptImportError:print("WiFi secrets are kept in secrets.py, please add them there!")raise# Create JWT Claimsclaims={"iss":"joe","exp":1300819380,"name":"John Doe","admin":True}# Generate JWT, sign with RSA private key and RS-256encoded_jwt=adafruit_jwt.JWT.generate(claims,secrets["private_key"],algo="RS256")print("Encoded JWT: ",encoded_jwt)Validating a generated JWT, encoded_jwt.importadafruit_jwtdecoded_jwt=adafruit_jwt.JWT.validate(encoded_jwt)# The decoded JWT's JOSE header and claims set are returned as a tupleprint('JOSE Header:{}\nJWT Claims:{}'.format(decoded_jwt[0],decoded_jwt[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-l3gd20
IntroductionAdafruit 9-DOF Absolute Orientation IMU Fusion Breakout - L3GD20 DriverDependenciesThis driver depends on:Adafruit CircuitPythonRegisterPlease 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-l3gd20To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-l3gd20To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-l3gd20Usage ExampleOf course, you must import the library to use it:importadafruit_l3gd20This driver takes an instantiated and active I2C object as an argument to its constructor.importboardi2c=board.I2C()Once you have the I2C object, you can create the sensor object:sensor=adafruit_l3gd20.L3GD20_I2C(i2c)And then you can start reading the measurements:print(sensor.gyro)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-lc709203f
IntroductionLibrary for I2C LC709203F battery status and fuel gaugeDependenciesThis 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 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-lc709203fTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lc709203fTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lc709203fUsage ExampleExamples of using this module are 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-led-animation
IntroductionPerform a variety of LED animation tasksDependenciesThis 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-led-animationTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-led-animationTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-led-animationUsage Exampleimportboardimportneopixelfromadafruit_led_animation.animation.blinkimportBlinkimportadafruit_led_animation.colorascolor# Works on Circuit Playground Express and Bluefruit.# For other boards, change board.NEOPIXEL to match the pin to which the NeoPixels are attached.pixel_pin=board.NEOPIXEL# Change to match the number of pixels you have attached to your board.num_pixels=10pixels=neopixel.NeoPixel(pixel_pin,num_pixels)blink=Blink(pixels,0.5,color.PURPLE)whileTrue:blink.animate()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.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.venvsource.venv/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.venv/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixcircuitpython-led_animation--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.venvsource.venv/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-lidarlite
IntroductionA CircuitPython & Python library for Garmin LIDAR Lite sensors over I2CDoes not work with Lidar Lite v4 at this time, no ETA when it may be added - PRs accepted!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-lidarliteTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lidarliteTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lidarliteUsage ExamplesV3 Exampleimporttimeimportboardimportbusioimportadafruit_lidarlite# Create library object using our Bus I2C porti2c=busio.I2C(board.SCL,board.SDA)# Default configuration, with only i2c wiressensor=adafruit_lidarlite.LIDARLite(i2c)whileTrue:try:# We print tuples so you can plot with Mu Plotterprint((sensor.distance,))exceptRuntimeErrorase:# If we get a reading error, just print it and keep truckin'print(e)time.sleep(0.01)# you can remove this for ultra-fast measurements!V3 HP Exampleimporttimeimportbusioimportboardimportadafruit_lidarlitei2c=busio.I2C(board.SCL,board.SDA)sensor=adafruit_lidarlite.LIDARLite(i2c,sensor_type=adafruit_lidarlite.TYPE_V3HP)whileTrue:try:print(f"Sensor ID#:{sensor.unit_id}")print(f"Distance ={sensor.distance}")print(f" Strength:{sensor.signal_strength}")exceptRuntimeErrorase:print(e)try:print(f"Status: 0b{sensor.status:b}")print(f" Busy:{bool(sensor.status&adafruit_lidarlite.STATUS_BUSY_V3HP)}")print(f" Overflow:{bool(sensor.status&adafruit_lidarlite.STATUS_SIGNAL_OVERFLOW_V3HP)}")print(f" Health: 0b{sensor.health_status:b}")print(f" Power Control: 0b{sensor.power_control:b}")print(f" I2C Config: 0b{sensor.i2c_config:b}")print(f" Test Command: 0b{sensor.test_command:b}")print(f" Correlation: 0b{sensor.correlation_data}")exceptRuntimeErrorase:print(e)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-lifx
IntroductionControlLIFX devicesover the internet using CircuitPython.DependenciesThis driver depends on:Adafruit CircuitPythonYou’ll also need a library to communicate with an ESP32 as a coprocessor using a WiFiManager object. This library supports connecting an ESP32 using either SPI or UART.SPI:Adafruit CircuitPython ESP32SPIUART:Adafruit CircuitPython ESP_ATcontrolPlease 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-lifxTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lifxTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lifxUsage ExampleInitialize the LIFX API Client with a WiFiManager object and aLIFX Personal Access token:lifx=adafruit_lifx.LIFX(wifi,lifx_token)Set aLIFX selectorlabel to identify the LIFX device to communicate with.lifx_light='label:Lamp'List all connected LIFX devices:lights=lifx.list_lights()Toggle the state of a LIFX device:lifx.toggle_light(lifx_light)Set the brightness of a LIFX device to 50%:lifx.set_brightness(lifx_light,0.5)Set the color of a LIFX device to blue and the brightness to 100%:lifx.set_color(lifx_light,'on','blue',brightness=1.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-lis2mdl
IntroductionAdafruit CircuitPython module for the LIS2MDL 3-axis magnetometerDependenciesThis 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-lis2mdlTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lis2mdlTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lis2mdlUsage Exampleimporttimeimportboardimportadafruit_lis2mdli2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_lis2mdl.LIS2MDL(i2c)whileTrue:mag_x,mag_y,mag_z=sensor.magneticprint('Magnetometer (uT): ({0:10.3f},{1:10.3f},{2:10.3f})'.format(mag_x,mag_y,mag_z))print('')time.sleep(1.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-lis331
IntroductionA library for the ST LIS331 family of high-g 3-axis 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-lis331To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lis331To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lis331Usage Exampleimporttimeimportboardimportadafruit_lis331i2c=board.I2C()# uses board.SCL and board.SDAlis=adafruit_lis331.LIS331(i2c)whileTrue:print("Acceleration : X:%.2f, Y:%.2f, Z:%.2fms^2"%lis.acceleration)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-lis3dh
IntroductionAdafruit CircuitPython module for the LIS3DH accelerometer.Note this module is made to work with CircuitPython and not MicroPython APIs.Usage ExampleSee the guide at:https://learn.adafruit.com/circuitpython-hardware-lis3dh-accelerometerDependenciesThis 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-lis3dhTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lis3dhTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lis3dhDocumentationAPI 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-lis3mdl
IntroductionCircuitPython helper library for the LIS3MDL 3-axis magnetometerDependenciesThis 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-lis3mdlTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lis3mdlTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lis3mdlUsage Exampleimporttimeimportboardimportadafruit_lis3mdli2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_lis3mdl.LIS3MDL(i2c)whileTrue:mag_x,mag_y,mag_z=sensor.magneticprint('X:{0:10.2f}, Y:{1:10.2f}, Z:{2:10.2f}uT'.format(mag_x,mag_y,mag_z))print('')time.sleep(1.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-logging
IntroductionLogging module for CircuitPythonDependenciesThis 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 Exampleimportadafruit_loggingaslogginglogger=logging.getLogger('test')logger.setLevel(logging.ERROR)logger.info('Info message')logger.error('Error message')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-lps2x
IntroductionLibrary for the ST LPS2x family of barometric pressure sensorsDependenciesThis 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-lps2xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lps2xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lps2xUsage Exampleimporttimeimportboardimportadafruit_lps2xi2c=board.I2C()# uncomment and comment out the line after to use with the LPS22# lps = adafruit_lps2x.LPS22(i2c)lps=adafruit_lps2x.LPS25(i2c)whileTrue:print("Pressure:%.2fhPa"%lps.pressure)print("Temperature:%.2fC"%lps.temperature)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-lps35hw
IntroductionA driver for the ST LPS35HW water resistant mems pressure 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-lps35hwTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lps35hwTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lps35hwUsage ExampleSee the guide at:https://learn.adafruit.comDocumentationAPI 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-lsm303
IntroductionAdafruit CircuitPython module for the LSM303 6-DoF with 3-axis accelerometer and magnetometerDependenciesThis 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 Exampleimporttimeimportboardimportbusioimportadafruit_lsm303i2c=busio.I2C(board.SCL,board.SDA)sensor=adafruit_lsm303.LSM303(i2c)whileTrue:raw_accel_x,raw_accel_y,raw_accel_z=sensor.raw_accelerationaccel_x,accel_y,accel_z=sensor.accelerationraw_mag_x,raw_mag_y,raw_mag_z=sensor.raw_magneticmag_x,mag_y,mag_z=sensor.magneticprint('Acceleration raw: ({0:6d},{1:6d},{2:6d}), (m/s^2): ({3:10.3f},{4:10.3f},{5:10.3f})'.format(raw_accel_x,raw_accel_y,raw_accel_z,accel_x,accel_y,accel_z))print('Magnetometer raw: ({0:6d},{1:6d},{2:6d}), (gauss): ({3:10.3f},{4:10.3f},{5:10.3f})'.format(raw_mag_x,raw_mag_y,raw_mag_z,mag_x,mag_y,mag_z))print('')time.sleep(1.0)ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyTo 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-lsm303--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-lsm303-accel
IntroductionAdafruit CircuitPython module for the LSM303’s accelerometerDependenciesThis 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-lsm303_accelTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm303_accelTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lsm303_accelUsage Exampleimporttimeimportboardimportadafruit_lsm303_acceli2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_lsm303_accel.LSM303_Accel(i2c)whileTrue:acc_x,acc_y,acc_z=sensor.accelerationprint('Acceleration (m/s^2): ({0:10.3f},{1:10.3f},{2:10.3f})'.format(acc_x,acc_y,acc_z))print('')time.sleep(1.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-lsm303agr-mag
IntroductionAdafruit CircuitPython module for the LSM303AGR’s 3-axis magnetometerDependenciesThis 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 Exampleimporttimeimportboardimportbusioimportadafruit_lsm303agr_magi2c=busio.I2C(board.SCL,board.SDA)sensor=adafruit_lsm303agr_mag.LSM303AGR_Mag(i2c)whileTrue:mag_x,mag_y,mag_z=sensor.magneticprint('Magnetometer (gauss): ({0:10.3f},{1:10.3f},{2:10.3f})'.format(mag_x,mag_y,mag_z))print('')time.sleep(1.0)ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyTo 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-lsm303agr-mag--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-lsm303dlh-mag
IntroductionAdafruit CircuitPython module for the LSM303DLH’s 3-axis magnetometerNote that this is specifically intended for the LSM303DLHC, as opposed to the LSM303DLH proper, which has the magnetic Y and Z orientations swapped.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-lsm303dlh_magTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm303dlh_magTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lsm303dlh_magUsage Exampleimporttimeimportboardimportadafruit_lsm303dlh_magi2c=board.I2C()# uses board.SCL and board.SDAsensor=adafruit_lsm303dlh_mag.LSM303DLH_Mag(i2c)whileTrue:mag_x,mag_y,mag_z=sensor.magneticprint('Magnetometer (gauss): ({0:10.3f},{1:10.3f},{2:10.3f})'.format(mag_x,mag_y,mag_z))print('')time.sleep(1.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-lsm6ds
IntroductionCircuitPython helper library for the LSM6DS family of motion sensors from STDependenciesThis 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-lsm6dsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm6dsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lsm6dsUsage Exampleimporttimeimportboardfromadafruit_lsm6ds.lsm6dsoximportLSM6DSOXi2c=board.I2C()# uses board.SCL and board.SDAsox=LSM6DSOX(i2c)whileTrue:print("Acceleration: X:%.2f, Y:%.2f, Z:%.2fm/s^2"%(sox.acceleration))print("Gyro X:%.2f, Y:%.2f, Z:%.2fradians/s"%(sox.gyro))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-lsm6dsox
IntroductionCircuitPython library for the ST LSM6DSOX, LSM6DS33, and ISM330DHCT 6-dof Accelerometer and GyrosDependenciesThis 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-lsm6dsTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm6dsTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-lsm6dsUsage Exampleimporttimeimportboardimportbusioimportadafruit_lsm6dsi2c=busio.I2C(board.SCL,board.SDA)sox=adafruit_lsm6ds.LSM6DSOX(i2c)whileTrue:print("Acceleration: X:%.2f, Y:%.2f, Z:%.2fm/s^2"%(sox.acceleration))print("Gyro X:%.2f, Y:%.2f, Z:%.2fdegrees/s"%(sox.gyro))print("")time.sleep(0.5)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-lsm9ds0
IntroductionCircuitPython module for the LSM9DS0 accelerometer, magnetometer, gyroscope.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-lsm9ds0To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm9ds0To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lsm9ds0Usage Exampleimporttimeimportboardimportbusioimportadafruit_lsm9ds0i2c=busio.I2C(board.SCL,board.SDA)sensor=adafruit_lsm9ds0.LSM9DS0_I2C(i2c)whileTrue:accel_x,accel_y,accel_z=sensor.accelerationmag_x,mag_y,mag_z=sensor.magneticgyro_x,gyro_y,gyro_z=sensor.gyrotemp=sensor.temperatureprint('Acceleration (m/s^2): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(accel_x,accel_y,accel_z))print('Magnetometer (gauss): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(mag_x,mag_y,mag_z))print('Gyroscope (degrees/sec): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(gyro_x,gyro_y,gyro_z))print('Temperature:{0:0.3f}C'.format(temp))time.sleep(1.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-lsm9ds1
IntroductionCircuitPython module for the LSM9DS1 accelerometer, magnetometer, gyroscope.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-lsm9ds1To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-lsm9ds1To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-lsm9ds1Usage ExampleSee examples/lsm9ds1_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-ltr329-ltr303
IntroductionPython & CircuitPython driver for LTR-329 or LTR-303 light sensorsDependenciesThis 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-ltr329-ltr303To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ltr329-ltr303To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.envsource.env/bin/activatepip3installadafruit-circuitpython-ltr329-ltr303Installing 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:circupinstallltr329-ltr303Or the following command to update an existing version:circupupdateUsage ExampleUsage examples 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-ltr390
IntroductionAdafruit CircuitPython library for the LTR390DependenciesThis 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-ltr390To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-ltr390To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-ltr390Usage Exampleimporttimeimportboardimportadafruit_ltr390i2c=board.I2C()ltr=adafruit_ltr390.LTR390(i2c)whileTrue:print("UV:",ltr.uvs,"\t\tAmbient Light:",ltr.light)time.sleep(1.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-macropad
IntroductionA helper library for the Adafruit MacroPad RP2040.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit’s CircuitPython NeoPixel libraryAdafruit’s CircuitPython HID libraryAdafruit’s CircuitPython MIDI libraryAdafruit’s CircuitPython Display Text libraryAdafruit’s CircuitPython Simple Text Display libraryAdafruit’s CircuitPython Debouncer libraryAdafruit’s CircuitPython Ticks libraryPlease 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 is designed to work withe the Adafruit MacroPad RP2040. Consider purchasing one from the Adafruit shop:Adafruit MacroPad RP2040 Bare BonesAdafruit MacroPad RP2040 Starter KitInstalling 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_macropadOr the following command to update an existing version:circupupdateUsage ExampleThis example prints out the key pressed, the relative position of the rotary encoder and the state of the rotary encoder switch.fromadafruit_macropadimportMacroPadimporttimemacropad=MacroPad()whileTrue:key_event=macropad.keys.events.get()ifkey_eventandkey_event.pressed:print("Key pressed:{}".format(key_event.key_number))print("Encoder:{}".format(macropad.encoder))print("Encoder switch:{}".format(macropad.encoder_switch))time.sleep(0.4)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-magtag
IntroductionHelper library for the Adafruit MagTag.DependenciesThis driver depends on:Adafruit CircuitPythonAdafruit PortalBasePlease ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage Example# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries## SPDX-License-Identifier: Unlicenseimporttimeimportterminaliofromadafruit_magtag.magtagimportMagTagmagtag=MagTag()magtag.add_text(text_font=terminalio.FONT,text_position=(50,(magtag.graphics.display.height//2)-1,),text_scale=3,)magtag.set_text("Hello World")buttons=magtag.peripherals.buttonsbutton_colors=((255,0,0),(255,150,0),(0,255,255),(180,0,255))button_tones=(1047,1318,1568,2093)timestamp=time.monotonic()whileTrue:fori,binenumerate(buttons):ifnotb.value:print("Button%cpressed"%chr((ord("A")+i)))magtag.peripherals.neopixel_disable=Falsemagtag.peripherals.neopixels.fill(button_colors[i])magtag.peripherals.play_tone(button_tones[i],0.25)breakelse:magtag.peripherals.neopixel_disable=Truetime.sleep(0.01)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-matrixkeypad
IntroductionThis simple helper library lets you create objects that will scan and detect keypresses on passive matrix keypadsDependenciesThis 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-matrixkeypadTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-matrixkeypadTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-matrixkeypadUsage Exampleimportadafruit_matrixkeypadfromdigitalioimportDigitalInOutimportboard# Classic 3x4 matrix keypadcols=[DigitalInOut(x)forxin(board.D2,board.D0,board.D4)]rows=[DigitalInOut(x)forxin(board.D1,board.D6,board.D5,board.D3)]keys=((1,2,3),(4,5,6),(7,8,9),('*',0,'#'))keypad=adafruit_matrixkeypad.Matrix_Keypad(rows,cols,keys)whileTrue:keys=keypad.pressed_keysifkeys:print("Pressed: ",keys)time.sleep(0.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-matrixportal
IntroductionCircuitPython helper for Adafruit MatrixPortal M4, Adafruit RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix FeatherWingsDependenciesThis 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 Exampleimporttimeimportboardimportterminaliofromadafruit_matrixportal.matrixportalimportMatrixPortal# --- Display setup ---matrixportal=MatrixPortal(status_neopixel=board.NEOPIXEL,debug=True)# Create a new label with the color and text selectedmatrixportal.add_text(text_font=terminalio.FONT,text_position=(0,(matrixportal.graphics.display.height//2)-1),scrolling=True,)SCROLL_DELAY=0.03contents=[{'text':'THIS IS RED','color':'#cf2727'},{'text':'THIS IS BLUE','color':'#0846e4'},]whileTrue:forcontentincontents:matrixportal.set_text(content['text'])# Set the text colormatrixportal.set_text_color(content['color'])# Scroll itmatrixportal.scroll_text(SCROLL_DELAY)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-max1704x
IntroductionMAX17048 or MAX17049 battery fuel gauge 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.This library is intended to work with the MAX17048 or MAX17049 battery fuel gauge Python/CircuitPython library.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-max1704xTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max1704xTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max1704xInstalling 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_max1704xOr the following command to update an existing version:circupupdateUsage ExampleSee usage examples of this library 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-max31855
IntroductionCircuitPython driver for theMAX31855 Thermocouple Amplifier BreakoutDependenciesThis 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-max31855To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max31855To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max31855Usage ExampleOf course, you must import the library to use it:importadafruit_max31855You also need to create an SPI interface object, and a pin object for the chip select pin. You can use any pin for the CS, but we use D5 here:fromdigitalioimportDigitalInOutimportboardspi=board.SPI()cs=DigitalInOut(board.D5)Next, just create the sensor object:sensor=adafruit_max31855.MAX31855(spi,cs)And you can start making measurements:print(sensor.temperature)The temperature is read in degrees Celsius (°C). You have to convert it to other units yourself, if you need it.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-max31856
IntroductionA CircuitPython driver for the MAX31856 Universal Thermocouple AmplifierDependenciesThis 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-max31856To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max31856To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max31856Usage Exampleimportboardimportdigitalioimportadafruit_max31856# Create sensor object, communicating over the board's default SPI busspi=board.SPI()# allocate a CS pin and set the directioncs=digitalio.DigitalInOut(board.D5)cs.direction=digitalio.Direction.OUTPUT# create a thermocouple object with the abovethermocouple=adafruit_max31856.MAX31856(spi,cs)# measure the temperature! (takes approx 160ms)print(thermocouple.temperature)# alternative (non-blocking) way to get temperaturethermocouple.initiate_one_shot_measurement()# <perform other tasks># now wait for measurement to completewhilethermocouple.oneshot_pending:passprint(thermocouple.unpack_temperature())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-max31865
IntroductionCircuitPython module for the MAX31865 thermocouple amplifier.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-max31865To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max31865To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max31865Usage ExampleSee examples/max31865_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-max7219
IntroductionCircuitPython driver for the MAX7219 LED matrix driver chip.Seeherefor the equivalent MicroPython 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-max7219To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max7219To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max7219Usage ExampleSee theexamples/folder example uses 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-max9744
IntroductionCircuitPython module for the MAX9744 20W class D amplifier.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-max9744To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-max9744To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-max9744Usage ExampleSee examples/max9744_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-mcp230xx
IntroductionCircuitPython module for the MCP23017/08 I2C and MCP23S17/08 SPI I/O extenders.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-mcp230xxTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp230xxTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp230xxUsage ExampleSee examples/mcp230xx_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.WarningSome people have reported an undocumented bug that can potentially corrupt the I2C bus. It occurs if an MCP230XX input pin state changes during I2C readout.This should be very rare.For more information, see thisforum postand thisknowledge base article.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
adafruit-circuitpython-mcp2515
IntroductionA CircuitPython library for working with the MCP2515 CAN bus 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 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-mcp2515To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp2515To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp2515Usage Exampleimportboardimportbusioimportdigitalioimportadafruit_mcp2515CS_PIN=5cs=digitalio.DigitalInOut(board.D5)cs.direction=digitalio.Direction.OUTPUTspi=busio.SPI(board.SCK,board.MOSI,board.MISO)mcp=adafruit_mcp2515.MCP2515(spi,cs)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-mcp3421
IntroductionCircuitPython driver for the MCP3421 analog to digital converterDependenciesThis 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-mcp3421To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp3421To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-mcp3421Installing 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_mcp3421Or the following command to update an existing version:circupupdateUsage Exampleimporttimeimportboardimportadafruit_mcp3421.mcp3421asADCfromadafruit_mcp3421.analog_inimportAnalogIni2c=board.I2C()adc=ADC.MCP3421(i2c)adc_channel=AnalogIn(adc)whileTrue:print((adc_channel.value,))time.sleep(0.01)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-mcp3xxx
IntroductionCircuitPython library for the MCP3xxx series of analog-to-digital converters.Currently supports:MCP3008: 8-Channel 10-Bit ADC With SPI InterfaceDependenciesThis 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-mcp3xxxTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp3xxxTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp3xxxUsage ExampleMCP3008 Single Endedimportbusioimportdigitalioimportboardimportadafruit_mcp3xxx.mcp3008asMCPfromadafruit_mcp3xxx.analog_inimportAnalogIn# create the spi busspi=busio.SPI(clock=board.SCK,MISO=board.MISO,MOSI=board.MOSI)# create the cs (chip select)cs=digitalio.DigitalInOut(board.D5)# create the mcp objectmcp=MCP.MCP3008(spi,cs)# create an analog input channel on pin 0chan=AnalogIn(mcp,MCP.P0)print('Raw ADC Value: ',chan.value)print('ADC Voltage: '+str(chan.voltage)+'V')MCP3008 Differentialimportbusioimportdigitalioimportboardimportadafruit_mcp3xxx.mcp3008asMCPfromadafruit_mcp3xxx.analog_inimportAnalogIn# create the spi busspi=busio.SPI(clock=board.SCK,MISO=board.MISO,MOSI=board.MOSI)# create the cs (chip select)cs=digitalio.DigitalInOut(board.D5)# create the mcp objectmcp=MCP.MCP3008(spi,cs)# create a differential ADC channel between Pin 0 and Pin 1chan=AnalogIn(mcp,MCP.P0,MCP.P1)print('Differential ADC Value: ',chan.value)print('Differential ADC Voltage: '+str(chan.voltage)+'V')MCP3004 Single-Endedimportbusioimportdigitalioimportboardimportadafruit_mcp3xxx.mcp3004asMCPfromadafruit_mcp3xxx.analog_inimportAnalogIn# create the spi busspi=busio.SPI(clock=board.SCK,MISO=board.MISO,MOSI=board.MOSI)# create the cs (chip select)cs=digitalio.DigitalInOut(board.D5)# create the mcp objectmcp=MCP.MCP3004(spi,cs)# create an analog input channel on pin 0chan=AnalogIn(mcp,MCP.P0)print('Raw ADC Value: ',chan.value)print('ADC Voltage: '+str(chan.voltage)+'V')MCP3004 Differentialimportbusioimportdigitalioimportboardimportadafruit_mcp3xxx.mcp3004asMCPfromadafruit_mcp3xxx.analog_inimportAnalogIn# create the spi busspi=busio.SPI(clock=board.SCK,MISO=board.MISO,MOSI=board.MOSI)# create the cs (chip select)cs=digitalio.DigitalInOut(board.D5)# create the mcp objectmcp=MCP.MCP3004(spi,cs)# create a differential ADC channel between Pin 0 and Pin 1chan=AnalogIn(mcp,MCP.P0,MCP.P1)print('Differential ADC Value: ',chan.value)print('Differential ADC Voltage: '+str(chan.voltage)+'V')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-mcp4725
IntroductionCircuitPython module for the MCP4725 digital to analog converter.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-mcp4725To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp4725To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp4725Usage ExampleSee examples/max4725_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-mcp4728
IntroductionHelper library for the MCP4728 I2C 12-bit Quad DACDependenciesThis 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-mcp4728To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp4728To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp4728Usage Exampleimportboardimportadafruit_mcp4728i2c=board.I2C()# uses board.SCL and board.SDAmcp4728=adafruit_mcp4728.MCP4728(i2c)mcp4728.channel_a.value=65535# Voltage = VDDmcp4728.channel_b.value=int(65535/2)# VDD/2mcp4728.channel_c.value=int(65535/4)# VDD/4mcp4728.channel_d.value=0# 0Vmcp4728.save_settings()# save the current values to the eeprom,making them the default on power upDocumentationAPI 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-mcp9600
IntroductionThis is a CircuitPython driver for the MCP9600 thermocouple I2C amplifier. In addition to the MCP9600 breakout, you will also need a thermocouple, which can be found in the Adafruit store. The MCP9600 supports several thermocouple types for different temperature ranges. The “K” type is the default, with a range of -200C to +1372C.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-mcp9600To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp9600To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp9600Usage ExampleThis is a simple example showing the hot junction temperature (the temperature at the tip of the thermocouple). You may need to adjust the I2C frequency if you receive input/output errors.importboardimportbusiofromadafruit_bus_device.i2c_deviceimportI2CDevicefromadafruit_mcp9600importMCP9600i2c=busio.I2C(board.SCL,board.SDA,frequency=200000)try:# using default I2C register and "K" thermocoupledevice=MCP9600(i2c)print("temperature(C):",device.temperature)exceptValueError:print("MCP9600 sensor not detected")This example displays the ambient/room and hot junction temperatures at 1 second intervals. Turn on the Mu editor’s plotter option to view the temperatures in a real-time graph.importboardimportbusioimporttimefromadafruit_bus_device.i2c_deviceimportI2CDevicefromadafruit_mcp9600importMCP9600i2c=busio.I2C(board.SCL,board.SDA,frequency=200000)try:device=MCP9600(i2c)print("version:",device.version)whileTrue:print((device.ambient_temperature,device.temperature))time.sleep(1)exceptValueError:print("MCP9600 sensor not detected")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-mcp9808
IntroductionThe MCP9808 is an awesome, high accuracy temperature sensor that communicates over I2C. Its available onAdafruit as a breakout.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-mcp9808To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mcp9808To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mcp9808Usage NotesGetting the temperature in Celsius is easy! First, import all of the pins from the board, board.I2C() for native I2C communication and the thermometer library itself.importboardimportadafruit_mcp9808Next, initialize the I2C bus in a with statement so it always gets shut down ok. Then, construct the thermometer class:# Do one readingwithboard.I2C()asi2c:t=adafruit_mcp9808.MCP9808(i2c)# Finally, read the temperature property and print it outprint(t.temperature)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-midi
IntroductionA CircuitPython helper for encoding/decoding MIDI packets over a MIDI or UART connection.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-midiTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-midiTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-midiUsage Exampleimporttimeimportrandomimportusb_midiimportadafruit_midifromadafruit_midi.note_onimportNoteOnfromadafruit_midi.note_offimportNoteOfffromadafruit_midi.pitch_bendimportPitchBendfromadafruit_midi.control_changeimportControlChangemidi=adafruit_midi.MIDI(midi_out=usb_midi.ports[1],out_channel=0)print("Midi test")print("Default output MIDI channel:",midi.out_channel+1)whileTrue:midi.send(NoteOn(44,120))# G sharp 2nd octavetime.sleep(0.25)a_pitch_bend=PitchBend(random.randint(0,16383))midi.send(a_pitch_bend)time.sleep(0.25)midi.send([NoteOff("G#2",120),ControlChange(3,44)])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-miniesptool
IntroductionROM loader for ESP chips, works with ESP8266 or ESP32. This is a ‘no-stub’ loader, so you can’t read MD5 or firmware back on ESP8266.See this document for protocol we’re implementing:https://github.com/espressif/esptool/wiki/Serial-ProtocolSee this for the ‘original’ code we’re miniaturizing:https://github.com/espressif/esptool/blob/master/esptool.pyThere’s a very basic Arduino ROM loader here for ESP32:https://github.com/arduino-libraries/WiFiNINA/tree/master/examples/Tools/FirmwareUpdaterDependenciesThis 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-miniesptoolTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-miniesptoolTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-miniesptoolUsage ExampleCheck the examples folder for demo sketches to upload firmware to ESP8266 and ESP32DocumentationAPI 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-minimqtt
IntroductionMQTT Client library 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-minimqttTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-minimqttTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-minimqttUsage ExamplePlease check theexamples folderfor usage examples for 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-miniqr
IntroductionA non-hardware dependant miniature QR generator library. All native Python!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-miniqrTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-miniqrTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-miniqrUsage Exampleimportadafruit_miniqrqr=adafruit_miniqr.QRCode()qr.add_data(b'https://www.adafruit.com')qr.make()print(qr.matrix)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-mlx90393
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.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mlx90939Usage Exampleimporttimeimportboardimportadafruit_mlx90393i2c=board.I2C()# uses board.SCL and board.SDASENSOR=adafruit_mlx90393.MLX90393(i2c,gain=adafruit_mlx90393.GAIN_1X)whileTrue:MX,MY,MZ=SENSOR.magneticprint("[{}]".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()time.sleep(1.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-mlx90395
IntroductionCircuitPython helper library for using the Adafruit MLX90395 tri-Axis magnetometer breakoutDependenciesThis 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-mlx90395To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mlx90395To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mlx90395Usage Examplefromtimeimportsleepimportboardimportbusiofromadafruit_mlx90395importMLX90395,OSRi2c=busio.I2C(board.SCL,board.SDA)sensor=MLX90395(i2c)whileTrue:mag_x,mag_y,mag_z=sensor.magneticprint("X1:{0:10.2f}, Y:{1:10.2f}, Z:{2:10.2f}uT".format(mag_x,mag_y,mag_z))print("")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-mlx90614
IntroductionCircuitPython module for the Melexis MLX90614 Contact-less Infrared Temperature sensor. See examples/mlx90614_simpletest.py for a demo of the usage.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-mlx90614To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-mlx90614To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-mlx90614Usage ExampleSee examples/mlx90614_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.