### Install Adafruit IS31FL3731 Library Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Install the library using pip. For system-wide installation, use sudo. For project-specific installations, create and activate a virtual environment. ```bash pip3 install adafruit-circuitpython-is31fl3731 ``` ```bash sudo pip3 install adafruit-circuitpython-is31fl3731 ``` ```bash mkdir project-name && cd project-name python3 -m venv .venv source .venv/bin/activate pip3 install adafruit-circuitpython-is31fl3731 ``` -------------------------------- ### Initialize CharlieWing Display and Control Pixels Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Initializes the CharlieWing display using I2C, fills all pixels, and demonstrates controlling individual pixels by turning them off, setting low brightness, and then higher brightness. ```python from adafruit_is31fl3731.charlie_wing import CharlieWing import board import busio with busio.I2C(board.SCL, board.SDA) as i2c: display = CharlieWing(i2c) display.fill(127) # Turn off pixel 4,4, change its brightness and turn it back on display.pixel(4, 4, 0) # Turn off. display.pixel(4, 4, 50) # Low brightness (50) display.pixel(4, 4, 192) # Higher brightness (192) ``` -------------------------------- ### Initialize Matrix Display Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Initializes the Matrix display using I2C communication and fills all pixels with a brightness of 127. ```python from adafruit_is31fl3731.matrix import Matrix import board import busio with busio.I2C(board.SCL, board.SDA) as i2c: display = Matrix(i2c) display.fill(127) ``` -------------------------------- ### RGBmatrix5x5 Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the 5x5 RGB Matrix display. ```APIDOC ## RGBmatrix5x5.pixel_addr() ### Description Sets the color of a single pixel using its address on the 5x5 RGB Matrix. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # rgbmatrix5x5_instance.pixel_addr(70, 90) ``` ### Response None ``` ```APIDOC ## RGBmatrix5x5.pixelrgb() ### Description Sets the RGB color of a single pixel on the 5x5 RGB Matrix. ### Method `pixelrgb(x: int, y: int, r: int, g: int, b: int)` ### Endpoint N/A (Method Call) ### Parameters - **x** (int) - Required - The x-coordinate of the pixel. - **y** (int) - Required - The y-coordinate of the pixel. - **r** (int) - Required - The red component of the color (0-255). - **g** (int) - Required - The green component of the color (0-255). - **b** (int) - Required - The blue component of the color (0-255). ### Request Example ```python # Example usage # rgbmatrix5x5_instance.pixelrgb(3, 3, 0, 0, 255) # Set pixel at (3,3) to blue ``` ### Response None ``` -------------------------------- ### Matrix Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods for controlling a generic Matrix display. ```APIDOC ## Matrix.image() ### Description Displays an image on the Matrix display. ### Method `image(img: object)` ### Endpoint N/A (Method Call) ### Parameters - **img** (object) - Required - An image object (e.g., from the Pillow library). ### Request Example ```python # Example usage with Pillow # from PIL import Image # img = Image.new('RGB', (width, height), color = 'blue') # matrix_instance.image(img) ``` ### Response None ``` ```APIDOC ## Matrix.pixel_addr() ### Description Sets the color of a single pixel using its address on the Matrix display. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # matrix_instance.pixel_addr(50, 255) ``` ### Response None ``` -------------------------------- ### LedShim Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the LedShim display. ```APIDOC ## LedShim.pixel_addr() ### Description Sets the color of a single pixel using its address on the LedShim. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # ledshim_instance.pixel_addr(40, 50) ``` ### Response None ``` ```APIDOC ## LedShim.pixelrgb() ### Description Sets the RGB color of a single pixel on the LedShim. ### Method `pixelrgb(x: int, y: int, r: int, g: int, b: int)` ### Endpoint N/A (Method Call) ### Parameters - **x** (int) - Required - The x-coordinate of the pixel. - **y** (int) - Required - The y-coordinate of the pixel. - **r** (int) - Required - The red component of the color (0-255). - **g** (int) - Required - The green component of the color (0-255). - **b** (int) - Required - The blue component of the color (0-255). ### Request Example ```python # Example usage # ledshim_instance.pixelrgb(2, 2, 0, 255, 0) # Set pixel at (2,2) to green ``` ### Response None ``` -------------------------------- ### Keybow2040 Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the Keybow2040 display. ```APIDOC ## Keybow2040.pixel_addr() ### Description Sets the color of a single pixel using its address on the Keybow2040. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # keybow2040_instance.pixel_addr(30, 100) ``` ### Response None ``` ```APIDOC ## Keybow2040.pixelrgb() ### Description Sets the RGB color of a single pixel on the Keybow2040. ### Method `pixelrgb(x: int, y: int, r: int, g: int, b: int)` ### Endpoint N/A (Method Call) ### Parameters - **x** (int) - Required - The x-coordinate of the pixel. - **y** (int) - Required - The y-coordinate of the pixel. - **r** (int) - Required - The red component of the color (0-255). - **g** (int) - Required - The green component of the color (0-255). - **b** (int) - Required - The blue component of the color (0-255). ### Request Example ```python # Example usage # keybow2040_instance.pixelrgb(1, 1, 255, 0, 0) # Set pixel at (1,1) to red ``` ### Response None ``` -------------------------------- ### Matrix11x7 Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the 11x7 Matrix display. ```APIDOC ## Matrix11x7.pixel_addr() ### Description Sets the color of a single pixel using its address on the 11x7 Matrix display. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # matrix11x7_instance.pixel_addr(60, 180) ``` ### Response None ``` -------------------------------- ### IS31FL3731 Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods available for the base IS31FL3731 class to control LED matrices. ```APIDOC ## IS31FL3731.audio_play() ### Description Starts audio playback on the device. ### Method `audio_play()` ### Endpoint N/A (Method Call) ### Parameters None ### Request Example ```python # Example usage # is31fl3731_instance.audio_play() ``` ### Response None ``` ```APIDOC ## IS31FL3731.audio_sync() ### Description Synchronizes audio playback. ### Method `audio_sync()` ### Endpoint N/A (Method Call) ### Parameters None ### Request Example ```python # Example usage # is31fl3731_instance.audio_sync() ``` ### Response None ``` ```APIDOC ## IS31FL3731.autoplay() ### Description Enables or disables automatic playback. ### Method `autoplay(enable: bool)` ### Endpoint N/A (Method Call) ### Parameters - **enable** (bool) - Required - Whether to enable autoplay. ### Request Example ```python # Example usage # is31fl3731_instance.autoplay(True) ``` ### Response None ``` ```APIDOC ## IS31FL3731.blink() ### Description Controls the blinking of LEDs. ### Method `blink(rate: int, duty_cycle: int)` ### Endpoint N/A (Method Call) ### Parameters - **rate** (int) - Required - The blinking rate. - **duty_cycle** (int) - Required - The blinking duty cycle. ### Request Example ```python # Example usage # is31fl3731_instance.blink(rate=10, duty_cycle=50) ``` ### Response None ``` ```APIDOC ## IS31FL3731.fade() ### Description Controls the fading of LEDs. ### Method `fade(rate: int, duty_cycle: int)` ### Endpoint N/A (Method Call) ### Parameters - **rate** (int) - Required - The fading rate. - **duty_cycle** (int) - Required - The fading duty cycle. ### Request Example ```python # Example usage # is31fl3731_instance.fade(rate=5, duty_cycle=75) ``` ### Response None ``` ```APIDOC ## IS31FL3731.fill() ### Description Fills the entire display with a specified color. ### Method `fill(color: int)` ### Endpoint N/A (Method Call) ### Parameters - **color** (int) - Required - The color to fill with (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # is31fl3731_instance.fill(255) # Fill with white ``` ### Response None ``` ```APIDOC ## IS31FL3731.frame() ### Description Sets the current frame for display. ### Method `frame(frame_num: int)` ### Endpoint N/A (Method Call) ### Parameters - **frame_num** (int) - Required - The frame number to set. ### Request Example ```python # Example usage # is31fl3731_instance.frame(1) ``` ### Response None ``` ```APIDOC ## IS31FL3731.image() ### Description Displays an image on the LED matrix. ### Method `image(img: object)` ### Endpoint N/A (Method Call) ### Parameters - **img** (object) - Required - An image object (e.g., from the Pillow library). ### Request Example ```python # Example usage with Pillow # from PIL import Image # img = Image.new('RGB', (width, height), color = 'red') # is31fl3731_instance.image(img) ``` ### Response None ``` ```APIDOC ## IS31FL3731.pixel() ### Description Sets the color of a single pixel. ### Method `pixel(x: int, y: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **x** (int) - Required - The x-coordinate of the pixel. - **y** (int) - Required - The y-coordinate of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # is31fl3731_instance.pixel(0, 0, 255) # Set pixel at (0,0) to white ``` ### Response None ``` ```APIDOC ## IS31FL3731.pixel_addr() ### Description Sets the color of a single pixel using its address. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # is31fl3731_instance.pixel_addr(5, 128) # Set pixel at address 5 to a medium brightness ``` ### Response None ``` ```APIDOC ## IS31FL3731.reset() ### Description Resets the device to its default state. ### Method `reset()` ### Endpoint N/A (Method Call) ### Parameters None ### Request Example ```python # Example usage # is31fl3731_instance.reset() ``` ### Response None ``` ```APIDOC ## IS31FL3731.sleep() ### Description Puts the device into a low-power sleep mode. ### Method `sleep(enable: bool)` ### Endpoint N/A (Method Call) ### Parameters - **enable** (bool) - Required - Whether to enable sleep mode. ### Request Example ```python # Example usage # is31fl3731_instance.sleep(True) ``` ### Response None ``` -------------------------------- ### CharlieWing Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the Charlie Wing display. ```APIDOC ## CharlieWing.pixel_addr() ### Description Sets the color of a single pixel using its address on the Charlie Wing. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # charlie_wing_instance.pixel_addr(20, 150) ``` ### Response None ``` -------------------------------- ### ScrollPhatHD Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the Scroll Phat HD display. ```APIDOC ## ScrollPhatHD.pixel_addr() ### Description Sets the color of a single pixel using its address on the Scroll Phat HD. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # scrollphathd_instance.pixel_addr(80, 255) ``` ### Response None ``` -------------------------------- ### CharlieBonnet Class Methods Source: https://adafruit-circuitpython-is31fl3731.readthedocs.io Methods specific to the Charlie Bonnet display. ```APIDOC ## CharlieBonnet.pixel_addr() ### Description Sets the color of a single pixel using its address on the Charlie Bonnet. ### Method `pixel_addr(addr: int, color: int)` ### Endpoint N/A (Method Call) ### Parameters - **addr** (int) - Required - The address of the pixel. - **color** (int) - Required - The color of the pixel (e.g., 0-255 for grayscale, or a specific RGB value). ### Request Example ```python # Example usage # charlie_bonnet_instance.pixel_addr(10, 200) ``` ### Response None ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.