Skip to content

Commit e1fcb5a

Browse files
committed
New handling for USER_PATTERN1 and USER_PATTERN2 and new UserPattern example. Improved MatrixPatternsTest example.
1 parent b1d8484 commit e1fcb5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1905
-1018
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ jobs:
6262
All: -DDO_NOT_SUPPORT_RGBW
6363

6464
- arduino-boards-fqbn: arduino:avr:leonardo
65-
build-properties:
66-
AllPatternOnOneBar: -DTEST_USER_PATTERNS
6765
sketches-exclude: AllPatternsOnMultiDevices,OpenLedRace # too big
6866

6967
- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Available as [Arduino library "NeoPatterns"](https://www.arduinolibraries.info/l
2323

2424
[![Button Install](https://img.shields.io/badge/Install-brightgreen?logoColor=white&logo=GitBook)](https://www.ardu-badge.com/NeoPatterns)
2525
   
26-
[![Button Changelog](https://img.shields.io/badge/Changelog-blue?logoColor=white&logo=AzureArtifacts)](https://github.com/ArminJo/NeoPatterns#revision-history)
26+
[![Button Changelog](https://img.shields.io/badge/Changelog-blue?logoColor=white&logo=AzureArtifacts)](https://github.com/ArminJo/NeoPatterns?tab=readme-ov-file#revision-history)
2727

2828
</div>
2929

@@ -71,11 +71,11 @@ The original **SCANNER** pattern is extended and includes the **CYLON** as well
7171
- SNOW
7272
- SNAKE
7373

74-
## Your own patterns
74+
## You can provide your own patterns
7575
- USER_PATTERN1
7676
- USER_PATTERN2
7777

78-
**Put your pattern code to the functions UserPattern\[1,2]() and UserPattern\[1,2]Update() in a file UserPattern.cpp to realize your own patterns.**
78+
**See UserPattern example.**
7979

8080
<br/>
8181

@@ -229,11 +229,14 @@ It also shows, how to dynamically **determine the length of the attached strip**
229229
# Revision History
230230
### Version 3.1.2 - work in progress
231231
- Added functions `getActualNeopixelLenghtSimple()`, `clearAndShow()`, `setMatrixPixelColorAndShow()` and `testMapping()`.
232+
- Improved `SNOW` pattern.
233+
- New handling for `USER_PATTERN1` and `USER_PATTERN2` and new UserPattern example.
234+
- Improved MatrixPatternsTest example.
232235

233236
### Version 3.1.1
234237
- Added parameter `aRepetitions` to pattern `RainbowCycle`.
235238
- Improved layout of character c.
236-
239+
237240
### Version 3.1.0
238241
- Added functions `printConnectionInfo()`, `fillRegion()`, `stop()` and `stopAllPatterns()`.
239242
- Fixed brightness initialization bug for Neopixel with UnderlyingNeoPixelObjects.

examples/AllPatternOnOneBar/AllPatternOnOneBar.ino

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,22 @@
3131

3232
#define INFO // if not defined, no Serial related code should be linked
3333

34-
//#define TEST_USER_PATTERNS // Activate this to test your own pattern implementation on line 74 ff.
35-
3634
// Which pin on the Arduino is connected to the NeoPixels?
3735
#define PIN_NEOPIXEL_BAR_16 3
3836

3937
// onComplete callback handler for all patterns
4038
void allPatterns(NeoPatterns *aLedsPtr);
4139

42-
// construct the NeoPatterns instances
43-
#if defined(TEST_USER_PATTERNS)
44-
void userPatternsHandler(NeoPatterns *aLedsPtr);
45-
NeoPatterns bar16 = NeoPatterns(16, PIN_NEOPIXEL_BAR_16, NEO_GRB + NEO_KHZ800, &userPatternsHandler);
46-
#else
40+
// Construct the NeoPatterns instances
4741
NeoPatterns bar16 = NeoPatterns(16, PIN_NEOPIXEL_BAR_16, NEO_GRB + NEO_KHZ800, &allPatterns);
48-
#endif
4942

5043
void setup() {
5144
pinMode(LED_BUILTIN, OUTPUT);
5245

5346
#if defined(INFO)
5447
Serial.begin(115200);
55-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
48+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
49+
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
5650
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
5751
#endif
5852
// Just to know which program is running on my Arduino

examples/AllPatternsOnMultiDevices/AllPatternsOnMultiDevices.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ void setup() {
107107
pinMode(LED_BUILTIN, OUTPUT);
108108

109109
Serial.begin(115200);
110-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
110+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
111+
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
111112
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
112113
#endif
113114
// Just to know which program is running on my Arduino

examples/MatrixDemo/MatrixDemo.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void setup() {
6767
pinMode(LED_BUILTIN, OUTPUT);
6868

6969
Serial.begin(115200);
70-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
70+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
71+
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
7172
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
7273
#endif
7374
// Just to know which program is running on my Arduino

0 commit comments

Comments
 (0)