Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nano 33 iot #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions RGBmatrixPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ void RGBmatrixPanel::init(uint8_t rows, uint8_t a, uint8_t b, uint8_t c,
) {
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_ESP32)
// R1, G1, B1, R2, G2, B2 pins
static const uint8_t defaultrgbpins[] = { 2,3,4,5,6,7 };
#if defined(ARDUINO_SAMD_NANO_33_IOT)
static const uint8_t defaultrgbpins[] = { 4,5,6,7,8,9 };
#else
static const uint8_t defaultrgbpins[] = { 2,3,4,5,6,7 };
#endif
memcpy(rgbpins, pinlist ? pinlist : defaultrgbpins, sizeof rgbpins);
#if defined(ARDUINO_ARCH_SAMD)
// All six RGB pins MUST be on the same PORT # as CLK
Expand Down Expand Up @@ -147,7 +151,7 @@ void RGBmatrixPanel::init(uint8_t rows, uint8_t a, uint8_t b, uint8_t c,
addrbport = portOutputRegister(digitalPinToPort(b));
addrbmask = digitalPinToBitMask(b);
addrcport = portOutputRegister(digitalPinToPort(c));
addrcmask = digitalPinToBitMask(c);
addrcmask = digitalPinToBitMask(c);
plane = nPlanes - 1;
row = nRows - 1;
swapflag = false;
Expand Down Expand Up @@ -870,10 +874,10 @@ void RGBmatrixPanel::updateDisplay(void) {
((ptr[i+WIDTH*2] << 2) & 0x0C);
CLKPORT = tick; // Clock lo
CLKPORT = tock; // Clock hi
}
}
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_ESP32)
for (int i=0; i<WIDTH; i++) {
byte b =
byte b =
( ptr[i] << 6) |
((ptr[i+WIDTH] << 4) & 0x30) |
((ptr[i+WIDTH*2] << 2) & 0x0C);
Expand All @@ -886,4 +890,3 @@ void RGBmatrixPanel::updateDisplay(void) {
#endif
}
}

14 changes: 9 additions & 5 deletions examples/PanelGFXDemo_16x32/PanelGFXDemo_16x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

//#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK 11 // USE THIS ON ARDUINO MEGA
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
10 changes: 7 additions & 3 deletions examples/colorwheel_32x32/colorwheel_32x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
15 changes: 14 additions & 1 deletion examples/colorwheel_progmem_32x32/colorwheel_progmem_32x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@
#include <RGBmatrixPanel.h>
#include "image.h" // Precomputed colorwheel image is here

// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
11 changes: 7 additions & 4 deletions examples/plasma_16x32/plasma_16x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down Expand Up @@ -126,4 +130,3 @@ void loop() {

matrix.swapBuffers(false);
}

11 changes: 7 additions & 4 deletions examples/plasma_32x32/plasma_32x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down Expand Up @@ -121,4 +125,3 @@ void loop() {
angle4 -= 0.15;
hueShift += 2;
}

10 changes: 7 additions & 3 deletions examples/scrolltext_16x32/scrolltext_16x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
11 changes: 7 additions & 4 deletions examples/testcolors_16x32/testcolors_16x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down Expand Up @@ -69,4 +73,3 @@ void setup() {
void loop() {
// Do nothing -- image doesn't change
}

10 changes: 7 additions & 3 deletions examples/testshapes_16x32/testshapes_16x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
10 changes: 7 additions & 3 deletions examples/testshapes_32x32/testshapes_32x32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
12 changes: 8 additions & 4 deletions examples/testshapes_32x64/testshapes_32x64.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
// Most of the signal pins are configurable, but the CLK pin has some
// special constraints. On 8-bit AVR boards it must be on PORTB...
// Pin 8 works on the Arduino Uno & compatibles (e.g. Adafruit Metro),
// Pin 11 works on the Arduino Mega. On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 11 works on the Arduino Mega.
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).
// Pin A6 works on the Nano 33 IoT
// On other 32-bit SAMD boards it must be on the same PORT as the RGB
// data pins (D2-D7)... Pin 8 works

#define CLK 8 // USE THIS ON ADAFRUIT METRO M0, etc.
#define CLK 8 // USE THIS ON ARDUINO UNO, ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE 9
//#define CLK A6 // USE THIS ON NANO 33 IoT
#define OE 9 // USE THIS ON EXCEPT ON NANO 33 IoT
//#define OE 11 // USE THIS ON NANO 33 IoT
#define LAT 10
#define A A0
#define B A1
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=RGB matrix Panel
version=1.1.1
version=1.1.2
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library and example code for the 16x32 RGB matrix panels in the shop
Expand Down