Current test suit

This commit is contained in:
2026-05-16 18:51:12 +02:00
parent c9100ea957
commit b2762feb57
604 changed files with 101539 additions and 0 deletions
@@ -0,0 +1,46 @@
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
something isn't working as expected. In many cases the problem is a common issue
that you will more quickly receive help from the forum community. GitHub issues
are meant for known defects in the code. If you don't know if there is a defect
in the code then start with troubleshooting on the forum first.
- **If following a tutorial or guide be sure you didn't miss a step.** Carefully
check all of the steps and commands to run have been followed. Consult the
forum if you're unsure or have questions about steps in a guide/tutorial.
- **For Arduino projects check these very common issues to ensure they don't apply**:
- For uploading sketches or communicating with the board make sure you're using
a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes
very hard to tell the difference between a data and charge cable! Try using the
cable with other devices or swapping to another cable to confirm it is not
the problem.
- **Be sure you are supplying adequate power to the board.** Check the specs of
your board and plug in an external power supply. In many cases just
plugging a board into your computer is not enough to power it and other
peripherals.
- **Double check all soldering joints and connections.** Flakey connections
cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.
- **Ensure you are using an official Arduino or Adafruit board.** We can't
guarantee a clone board will have the same functionality and work as expected
with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE**
- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO
VERSION HERE**
- List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): **LIST REPRO STEPS BELOW**
@@ -0,0 +1,26 @@
Thank you for creating a pull request to contribute to Adafruit's GitHub code!
Before you open the request please review the following guidelines and tips to
help it be more easily integrated:
- **Describe the scope of your change--i.e. what the change does and what parts
of the code were modified.** This will help us understand any risks of integrating
the code.
- **Describe any known limitations with your change.** For example if the change
doesn't apply to a supported platform of the library please mention it.
- **Please run any tests or examples that can exercise your modified code.** We
strive to not break users of the code and running tests/examples helps with this
process.
Thank you again for contributing! We will try to test and integrate the change
as soon as we can, but be aware we have many GitHub repositories to manage and
can't immediately respond to every request. There is no need to bump or check in
on a pull request (it will clutter the discussion of the request).
Also don't be worried if the request is closed or not integrated--sometimes the
priorities of Adafruit's GitHub code (education, ease of use) might not match the
priorities of the pull request. Don't fret, the open source community thrives on
forks and GitHub makes it easy to keep your changes in a forked repo.
After reviewing the guidelines above you can delete this text from the pull request.
@@ -0,0 +1,32 @@
name: Arduino Library CI
on: [pull_request, push, repository_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
path: ci
- name: pre-install
run: bash ci/actions_install.sh
- name: test platforms
run: python3 ci/build_platform.py main_platforms
- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "Adafruit IS31FL3731 Library"
run: bash ci/doxy_gen_and_deploy.sh
@@ -0,0 +1 @@
{"type": "library", "name": "Adafruit IS31FL3731 Library", "version": "2.0.2", "spec": {"owner": "adafruit", "id": 1241, "name": "Adafruit IS31FL3731 Library", "requirements": null, "uri": null}}
@@ -0,0 +1,273 @@
#include <Adafruit_IS31FL3731.h>
#ifndef _swap_int16_t
#define _swap_int16_t(a, b) \
{ \
int16_t t = a; \
a = b; \
b = t; \
}
#endif
/**************************************************************************/
/*!
@brief Constructor for breakout version
@param width Desired width of led display
@param height Desired height of led display
*/
/**************************************************************************/
Adafruit_IS31FL3731::Adafruit_IS31FL3731(uint8_t width, uint8_t height)
: Adafruit_GFX(width, height) {}
/**************************************************************************/
/*!
@brief Constructor for FeatherWing version (15x7 LEDs)
*/
/**************************************************************************/
Adafruit_IS31FL3731_Wing::Adafruit_IS31FL3731_Wing(void)
: Adafruit_IS31FL3731(15, 7) {}
/**************************************************************************/
/*!
@brief Initialize hardware and clear display
@param addr The I2C address we expect to find the chip at
@param theWire The TwoWire I2C bus device to use, defaults to &Wire
@returns True on success, false if chip isnt found
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::begin(uint8_t addr, TwoWire *theWire) {
if (_i2c_dev) {
delete _i2c_dev;
}
_i2c_dev = new Adafruit_I2CDevice(addr, theWire);
if (!_i2c_dev->begin()) {
return false;
}
_i2c_dev->setSpeed(400000);
_frame = 0;
// shutdown
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x00);
delay(10);
// out of shutdown
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x01);
// picture mode
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_CONFIG,
ISSI_REG_CONFIG_PICTUREMODE);
displayFrame(_frame);
// all LEDs on & 0 PWM
clear(); // set each led to 0 PWM
for (uint8_t f = 0; f < 8; f++) {
for (uint8_t i = 0; i <= 0x11; i++)
writeRegister8(f, i, 0xff); // each 8 LEDs on
}
audioSync(false);
return true;
}
/**************************************************************************/
/*!
@brief Sets all LEDs on & 0 PWM for current frame.
*/
/**************************************************************************/
void Adafruit_IS31FL3731::clear(void) {
selectBank(_frame);
uint8_t erasebuf[25];
memset(erasebuf, 0, 25);
for (uint8_t i = 0; i < 6; i++) {
erasebuf[0] = 0x24 + i * 24;
_i2c_dev->write(erasebuf, 25);
}
}
/**************************************************************************/
/*!
@brief Low level accesssor - sets a 8-bit PWM pixel value to a bank location
does not handle rotation, x/y or any rearrangements!
@param lednum The offset into the bank that corresponds to the LED
@param bank The bank/frame we will set the data in
@param pwm brightnes, from 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank) {
if (lednum >= 144)
return;
writeRegister8(bank, 0x24 + lednum, pwm);
}
/**************************************************************************/
/*!
@brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
handles rotation and pixel arrangement, unlike setLEDPWM
@param x The x position, starting with 0 for left-most side
@param y The y position, starting with 0 for top-most side
@param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731_Wing::drawPixel(int16_t x, int16_t y, uint16_t color) {
// check rotation, move pixel around if necessary
switch (getRotation()) {
case 1:
_swap_int16_t(x, y);
x = 15 - x - 1;
break;
case 2:
x = 15 - x - 1;
y = 7 - y - 1;
break;
case 3:
_swap_int16_t(x, y);
y = 9 - y - 1;
break;
}
// charlie wing is smaller:
if ((x < 0) || (x >= 16) || (y < 0) || (y >= 7))
return;
if (x > 7) {
x = 15 - x;
y += 8;
} else {
y = 7 - y;
}
_swap_int16_t(x, y);
if (color > 255)
color = 255; // PWM 8bit max
setLEDPWM(x + y * 16, color, _frame);
return;
}
/**************************************************************************/
/*!
@brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
handles rotation and pixel arrangement, unlike setLEDPWM
@param x The x position, starting with 0 for left-most side
@param y The y position, starting with 0 for top-most side
@param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::drawPixel(int16_t x, int16_t y, uint16_t color) {
// check rotation, move pixel around if necessary
switch (getRotation()) {
case 1:
_swap_int16_t(x, y);
x = 16 - x - 1;
break;
case 2:
x = 16 - x - 1;
y = 9 - y - 1;
break;
case 3:
_swap_int16_t(x, y);
y = 9 - y - 1;
break;
}
if ((x < 0) || (x >= 16))
return;
if ((y < 0) || (y >= 9))
return;
if (color > 255)
color = 255; // PWM 8bit max
setLEDPWM(x + y * 16, color, _frame);
return;
}
/**************************************************************************/
/*!
@brief Set's this object's frame tracker (does not talk to the chip)
@param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setFrame(uint8_t frame) { _frame = frame; }
/**************************************************************************/
/*!
@brief Have the chip set the display to the contents of a frame
@param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::displayFrame(uint8_t frame) {
if (frame > 7)
frame = 0;
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_PICTUREFRAME, frame);
}
/**************************************************************************/
/*!
@brief Switch to a given bank in the chip memory for future reads
@param bank The IS31 bank to switch to
@returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::selectBank(uint8_t bank) {
uint8_t cmd[2] = {ISSI_COMMANDREGISTER, bank};
return _i2c_dev->write(cmd, 2);
}
/**************************************************************************/
/*!
@brief Enable the audio 'sync' for brightness pulsing (not really tested)
@param sync True to enable, False to disable
*/
/**************************************************************************/
void Adafruit_IS31FL3731::audioSync(bool sync) {
if (sync) {
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x1);
} else {
writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x0);
}
}
/**************************************************************************/
/*!
@brief Write one byte to a register located in a given bank
@param bank The IS31 bank to write the register location
@param reg the offset into the bank to write
@param data The byte value
@returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::writeRegister8(uint8_t bank, uint8_t reg,
uint8_t data) {
selectBank(bank);
uint8_t cmd[2] = {reg, data};
return _i2c_dev->write(cmd, 2);
}
/**************************************************************************/
/*!
@brief Read one byte from a register located in a given bank
@param bank The IS31 bank to read the register location
@param reg the offset into the bank to read
@return 1 byte value
*/
/**************************************************************************/
uint8_t Adafruit_IS31FL3731::readRegister8(uint8_t bank, uint8_t reg) {
uint8_t val = 0xFF;
selectBank(bank);
_i2c_dev->write_then_read(&reg, 1, &val, 1);
return val;
}
@@ -0,0 +1,65 @@
#ifndef _ADAFRUIT_IS31FL3731_H_
#define _ADAFRUIT_IS31FL3731_H_
#include <Adafruit_GFX.h>
#include <Adafruit_I2CDevice.h>
#include <Arduino.h>
#define ISSI_ADDR_DEFAULT 0x74
#define ISSI_REG_CONFIG 0x00
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
#define ISSI_CONF_PICTUREMODE 0x00
#define ISSI_CONF_AUTOFRAMEMODE 0x04
#define ISSI_CONF_AUDIOMODE 0x08
#define ISSI_REG_PICTUREFRAME 0x01
#define ISSI_REG_SHUTDOWN 0x0A
#define ISSI_REG_AUDIOSYNC 0x06
#define ISSI_COMMANDREGISTER 0xFD
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
/**************************************************************************/
/*!
@brief Constructor for generic IS31FL3731 breakout version
*/
/**************************************************************************/
class Adafruit_IS31FL3731 : public Adafruit_GFX {
public:
Adafruit_IS31FL3731(uint8_t x = 16, uint8_t y = 9);
bool begin(uint8_t addr = ISSI_ADDR_DEFAULT, TwoWire *theWire = &Wire);
void drawPixel(int16_t x, int16_t y, uint16_t color);
void clear(void);
void setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank = 0);
void audioSync(bool sync);
void setFrame(uint8_t b);
void displayFrame(uint8_t frame);
protected:
bool selectBank(uint8_t bank);
bool writeRegister8(uint8_t bank, uint8_t reg, uint8_t data);
uint8_t readRegister8(uint8_t bank, uint8_t reg);
uint8_t _frame; ///< The frame (of 8) we are currently addressing
private:
Adafruit_I2CDevice *_i2c_dev = NULL;
};
/**************************************************************************/
/*!
@brief Constructor for FeatherWing IS31FL3731 version
*/
/**************************************************************************/
class Adafruit_IS31FL3731_Wing : public Adafruit_IS31FL3731 {
public:
Adafruit_IS31FL3731_Wing(void);
void drawPixel(int16_t x, int16_t y, uint16_t color);
};
#endif
@@ -0,0 +1,137 @@
<!--
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
SPDX-License-Identifier: CC-BY-4.0
-->
# Adafruit Community Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* Trolling, insulting/derogatory comments, and personal or political attacks
* Promoting or spreading disinformation, lies, or conspiracy theories against
a person, group, organisation, project, or community
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you don’t just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Moderators by tagging @community moderators. You may
also send an open message from any channel, or a direct message to
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our community’s standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.
[Contributor Covenant]: https://www.contributor-covenant.org
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Ladyada for Adafruit Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1 @@
# Adafruit IS31FL3731 [![Build Status](https://github.com/adafruit/Adafruit_IS31FL3731/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_IS31FL3731/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_IS31FL3731/html/index.html)
@@ -0,0 +1,107 @@
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>
// If you're using the full breakout...
Adafruit_IS31FL3731 matrix = Adafruit_IS31FL3731();
// If you're using the FeatherWing version
//Adafruit_IS31FL3731_Wing matrix = Adafruit_IS31FL3731_Wing();
static const uint8_t PROGMEM
smile_bmp[] =
{ 0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10100101,
0b10011001,
0b01000010,
0b00111100 },
neutral_bmp[] =
{ 0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10111101,
0b10000001,
0b01000010,
0b00111100 },
frown_bmp[] =
{ 0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10011001,
0b10100101,
0b01000010,
0b00111100 };
void setup() {
Serial.begin(9600);
Serial.println("ISSI manual animation test");
if (! matrix.begin()) {
Serial.println("IS31 not found");
while (1);
}
Serial.println("IS31 Found!");
}
void loop() {
matrix.setRotation(0);
matrix.clear();
matrix.drawBitmap(3, 0, smile_bmp, 8, 8, 255);
delay(500);
matrix.clear();
matrix.drawBitmap(3, 0, neutral_bmp, 8, 8, 64);
delay(500);
matrix.clear();
matrix.drawBitmap(3, 0, frown_bmp, 8, 8, 32);
delay(500);
matrix.clear();
matrix.drawPixel(0, 0, 255);
delay(500);
matrix.clear();
matrix.drawLine(0,0, matrix.width()-1, matrix.height()-1, 127);
delay(500);
matrix.clear();
matrix.drawRect(0,0, matrix.width(), matrix.height(), 255);
matrix.fillRect(2,2, matrix.width()-4, matrix.height()-4, 20);
delay(500);
matrix.clear();
matrix.drawCircle(8,4, 4, 64);
matrix.drawCircle(8,4, 2, 32);
delay(500);
matrix.setTextSize(1);
matrix.setTextWrap(false); // we dont want text to wrap so it scrolls nicely
matrix.setTextColor(100);
for (int8_t x=0; x>=-32; x--) {
matrix.clear();
matrix.setCursor(x,0);
matrix.print("Hello");
delay(100);
}
matrix.setTextSize(2);
matrix.setTextWrap(false); // we dont want text to wrap so it scrolls nicely
matrix.setTextColor(32);
matrix.setRotation(1);
for (int8_t x=7; x>=-64; x--) {
matrix.clear();
matrix.setCursor(x,0);
matrix.print("World");
delay(100);
}
}
@@ -0,0 +1,43 @@
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>
// If you're using the full breakout...
Adafruit_IS31FL3731 ledmatrix = Adafruit_IS31FL3731();
// If you're using the FeatherWing version
//Adafruit_IS31FL3731_Wing ledmatrix = Adafruit_IS31FL3731_Wing();
void setup() {
Serial.begin(9600);
Serial.println("ISSI manual animation test");
if (! ledmatrix.begin()) {
Serial.println("IS31 not found");
while (1);
}
Serial.println("IS31 Found!");
ledmatrix.setTextWrap(false);
ledmatrix.setTextColor(64); // quarter brightness
ledmatrix.setTextSize(1);
// fill all 8 frames with some text
for (uint8_t frame = 0; frame < 8; frame++) {
ledmatrix.setFrame(frame);
ledmatrix.clear();
ledmatrix.setCursor(0,0);
ledmatrix.write('a'+frame*3);
ledmatrix.write('b'+frame*3);
ledmatrix.write('c'+frame*3);
}
}
int x = 0;
void loop() {
// display each frame for 250 milliseconds
for (uint8_t frame = 0; frame < 8; frame++) {
ledmatrix.displayFrame(frame);
delay(250);
}
}
@@ -0,0 +1,32 @@
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>
// If you're using the full breakout...
Adafruit_IS31FL3731 ledmatrix = Adafruit_IS31FL3731();
// If you're using the FeatherWing version
//Adafruit_IS31FL3731_Wing ledmatrix = Adafruit_IS31FL3731_Wing();
// The lookup table to make the brightness changes be more visible
uint8_t sweep[] = {1, 2, 3, 4, 6, 8, 10, 15, 20, 30, 40, 60, 60, 40, 30, 20, 15, 10, 8, 6, 4, 3, 2, 1};
void setup() {
Serial.begin(9600);
Serial.println("ISSI swirl test");
if (! ledmatrix.begin()) {
Serial.println("IS31 not found");
while (1);
}
Serial.println("IS31 found!");
}
void loop() {
// animate over all the pixels, and set the brightness from the sweep table
for (uint8_t incr = 0; incr < 24; incr++)
for (uint8_t x = 0; x < 16; x++)
for (uint8_t y = 0; y < 9; y++)
ledmatrix.drawPixel(x, y, sweep[(x+y+incr)%24]);
delay(20);
}
@@ -0,0 +1,10 @@
name=Adafruit IS31FL3731 Library
version=2.0.2
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library for the Adafruit IS31FL3731 Charlieplex LED driver and CharliePlex FeatherWing.
paragraph=Arduino library for the Adafruit IS31FL3731 Charlieplex LED driver and CharliePlex FeatherWing.
category=Display
url=https://github.com/adafruit/Adafruit_IS31FL3731
architectures=*
depends=Adafruit GFX Library, Adafruit BusIO