Skip to content

Commit

Permalink
version 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Sep 24, 2020
1 parent c32aaac commit 191c72f
Show file tree
Hide file tree
Showing 21 changed files with 183 additions and 120 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/LibraryBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ jobs:
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:avr:uno|All-DO_NOT_SUPPORT_RGBW
examples-build-properties:
build-properties:
All:
-DDO_NOT_SUPPORT_RGBW

- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
examples-exclude: OpenLedRace,TwoPatternsOnOneStrip # Comma separated list of (unique substrings of) example names to exclude in build
sketches-exclude: OpenLedRace,TwoPatternsOnOneStrip # Comma separated list of (unique substrings of) example names to exclude in build

- arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80
platform-url: https://dl.espressif.com/dl/package_esp32_index.json
examples-exclude: OpenLedRace,TwoPatternsOnOneStrip # TwoPatternsOnOneStrip because of missing EasyButton library
sketches-exclude: OpenLedRace,TwoPatternsOnOneStrip # TwoPatternsOnOneStrip because of missing EasyButton library

# Do not cancel all jobs / architectures if one job fails
fail-fast: false
Expand All @@ -69,8 +69,8 @@ jobs:
ENV_ARDUINO_BOARD_FQBN: ${{ matrix.arduino-boards-fqbn }}
ENV_PLATFORM_URL: ${{ matrix.platform-url }}
ENV_REQUIRED_LIBRARIES: ${{ env.REQUIRED_LIBRARIES }}
ENV_EXAMPLES_EXCLUDE: ${{ matrix.examples-exclude }}
ENV_EXAMPLES_BUILD_PROPERTIES: ${{ toJson(matrix.examples-build-properties) }}
ENV_EXAMPLES_EXCLUDE: ${{ matrix.sketches-exclude }}
ENV_EXAMPLES_BUILD_PROPERTIES: ${{ toJson(matrix.build-properties) }}
run: |
wget --quiet https://raw.githubusercontent.com/ArminJo/arduino-test-compile/master/arduino-test-compile.sh
chmod +x arduino-test-compile.sh
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [NeoPatterns](https://github.com/ArminJo/NeoPatterns) for NeoPixel strips and Snake game for NeoPixel matrix.
Available as Arduino library "NeoPatterns"

### [Version 2.2.0](https://github.com/ArminJo/NeoPatterns/releases)
### [Version 2.2.1](https://github.com/ArminJo/NeoPatterns/releases)

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Installation instructions](https://www.ardu-badge.com/badge/NeoPatterns.svg?)](https://www.ardu-badge.com/NeoPatterns)
Expand Down Expand Up @@ -89,6 +89,9 @@ NeoPatterns on breadboard
![NeoPatterns on breadboard](https://github.com/ArminJo/NeoPatterns/blob/master/extras/Breadboard_complete.jpg)

# Revision History
### Version 2.2.1
- Removed blocking wait for ATmega32U4 Serial in examples.

### Version 2.2.0
- Added support for RGBW patterns. Requires additional 200 bytes for the AllPatternsOnMultiDevices example. Commenting out `#define SUPPORT_RGBW` or defining `DO_NOT_SUPPORT_RGBW` saves 400 bytes FLASH for the AllPatternsOnMultiDevices example.
- Use type `Print *` instead of `Stream *`.
Expand Down
5 changes: 1 addition & 4 deletions examples/AllPatternOnOneStrip/AllPatternOnOneStrip.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ void setup() {

#ifdef INFO
Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
2 changes: 1 addition & 1 deletion examples/AllPatternsOnMultiDevices/ADCUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
*/

#if defined(__AVR__)
#if defined(__AVR__) && (! defined(__AVR_ATmega4809__))
#include "ADCUtils.h"

// Union to speed up the combination of low and high bytes to a word
Expand Down
13 changes: 6 additions & 7 deletions examples/AllPatternsOnMultiDevices/ADCUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#ifndef SRC_ADCUTILS_H_
#define SRC_ADCUTILS_H_

#if defined(__AVR__)
#if defined(__AVR__) && (! defined(__AVR_ATmega4809__))
#include <Arduino.h>

// PRESCALE4 => 13 * 4 = 52 microseconds per ADC conversion at 1 Mhz Clock => 19,2 kHz
// PRESCALE4 => 13 * 4 = 52 microseconds per ADC conversion at 1 MHz Clock => 19,2 kHz
#define ADC_PRESCALE2 1 // 26 microseconds per ADC conversion at 1 MHz
#define ADC_PRESCALE4 2 // 52 microseconds per ADC conversion at 1 MHz
// PRESCALE8 => 13 * 8 = 104 microseconds per ADC sample at 1 Mhz Clock => 9,6 kHz
// PRESCALE8 => 13 * 8 = 104 microseconds per ADC sample at 1 MHz Clock => 9,6 kHz
#define ADC_PRESCALE8 3 // 104 microseconds per ADC conversion at 1 MHz
#define ADC_PRESCALE16 4 // 208 microseconds per ADC conversion at 1 MHz
#define ADC_PRESCALE32 5 // 416 microseconds per ADC conversion at 1 MHz
Expand All @@ -53,15 +53,14 @@
* After including this file you can not call the ATTinyCore readAnalog functions reliable, if you specify references other than default!
*/
#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
// defines are from Arduino.h, the can be used without bit reordering
#ifdef ATTINY_CORE
// defines are for ADCUtils.cpp, they can be used WITHOUT bit reordering
#undef DEFAULT
#undef EXTERNAL
#undef INTERNAL1V1
#undef INTERNAL
#undef INTERNAL2V56
#undef INTERNAL2V56_EXTCAP
#endif

#define DEFAULT 0
#define EXTERNAL 4
#define INTERNAL1V1 8
Expand All @@ -71,7 +70,7 @@

#define SHIFT_VALUE_FOR_REFERENCE REFS2
#define MASK_FOR_ADC_REFERENCE (_BV(REFS0) | _BV(REFS1) | _BV(REFS2))
#else
#else // AVR_ATtiny85
#define SHIFT_VALUE_FOR_REFERENCE REFS0
#define MASK_FOR_ADC_REFERENCE (_BV(REFS0) | _BV(REFS1))
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
5 changes: 1 addition & 4 deletions examples/MatrixDemo/MatrixDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
5 changes: 1 addition & 4 deletions examples/MatrixShowAllColors/MatrixShowAllColors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
5 changes: 1 addition & 4 deletions examples/NeoPatternsSimpleDemo/NeoPatternsSimpleDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ NeoPatterns bar16 = NeoPatterns(16, PIN_NEOPIXEL_BAR_16, NEO_GRB + NEO_KHZ800, &

void setup() {
Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
4 changes: 2 additions & 2 deletions examples/OpenLedRace/OpenLedRace.ino
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ void setup() {
#endif

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ "\r\nVersion " VERSION_EXAMPLE " from " __DATE__));
Expand Down
10 changes: 6 additions & 4 deletions examples/OpenLedRace/PlayRtttl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
#endif
#include "pitches.h"

#define VERSION_PLAY_RTTTL "1.4.0"
#define VERSION_PLAY_RTTTL "1.4.1"
#define VERSION_PLAY_RTTTL_MAJOR 1
#define VERSION_PLAY_RTTTL_MINOR 4

/*
* Version 1.4.1 - 9/2020
* - Removed blocking wait for ATmega32U4 Serial in examples.
*
* Version 1.4.0 - 1/2020
* - Supporting direct tone output at pin 11 for ATmega328. Can be used with interrupt blocking libraries for NeoPixel etc.
* - Use Print * instead of Stream *.
Expand Down Expand Up @@ -75,9 +78,8 @@
* - new setNumberOfLoops() and setDefaultStyle() functions.
*/

//#define USE_NON_STANDARD_SERIAL_FOR_DEBUG // if activated you must -you are able to- set your own serial class for debugging purposes by setSerialForPlayRtttlDebug()

#if ! defined(USE_NO_RTX_EXTENSIONS) // if defined it suppresses the next 2 defines / useful for ATtinies to shrink code
#if ! defined(USE_NO_RTX_EXTENSIONS) // if defined it suppresses the next 2 defines / useful for ATtinies to shrink code up to 182 bytes
// Even without `SUPPORT_RTX_EXTENSIONS` the default style is natural (Tone length = note length - 1/16)
#define SUPPORT_RTX_EXTENSIONS // needs additional 200 bytes FLASH - support loop and style
#define SUPPORT_RTX_FORMAT // needs additional 100 bytes FLASH - can read RTX formatted definitions
#endif
Expand Down
5 changes: 1 addition & 4 deletions examples/SnakeAutorun/SnakeAutorun.ino
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
5 changes: 1 addition & 4 deletions examples/SnakeGame/SnakeGame.ino
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ void setup() {
pinMode(TWO_BUTTON_MODE_SELECT_PIN, INPUT_PULLUP);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
5 changes: 1 addition & 4 deletions examples/SnowFlakes/SnowFlakes.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB)
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
// Just to know which program is running on my Arduino
Expand Down
Loading

0 comments on commit 191c72f

Please sign in to comment.