From c3a90bfab9ade40c256d1021e5d046c90632fcf3 Mon Sep 17 00:00:00 2001 From: Spence Konde Date: Mon, 14 Nov 2022 09:05:19 -0500 Subject: [PATCH] fix some more examples --- .../examples/RGBWstrandtest/RGBWstrandtest.ino | 2 +- .../tinyNeoPixel/examples/buttoncycler/buttoncycler.ino | 6 +++++- megaavr/libraries/tinyNeoPixel/examples/simple/simple.ino | 7 ++++++- .../tinyNeoPixel/examples/strandtest/strandtest.ino | 2 +- .../examples/buttoncycler/buttoncycler.ino | 4 ++++ .../tinyNeoPixel_Static/examples/simple/simple.ino | 6 +++++- .../tinyNeoPixel_Static/examples/strandtest/strandtest.ino | 7 +++++-- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/megaavr/libraries/tinyNeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino b/megaavr/libraries/tinyNeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino index e15e88c3..86e0b6d1 100644 --- a/megaavr/libraries/tinyNeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino +++ b/megaavr/libraries/tinyNeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino @@ -1,7 +1,7 @@ #include -#define PIN PIN_PC3 //chosen because all Dx and Ex parts have itz +#define PIN PIN_PC1 //chosen because all Dx and Ex parts have itz #define NUM_LEDS 60 #define BRIGHTNESS 50 diff --git a/megaavr/libraries/tinyNeoPixel/examples/buttoncycler/buttoncycler.ino b/megaavr/libraries/tinyNeoPixel/examples/buttoncycler/buttoncycler.ino index 7d9cb7c5..c36dc5a2 100644 --- a/megaavr/libraries/tinyNeoPixel/examples/buttoncycler/buttoncycler.ino +++ b/megaavr/libraries/tinyNeoPixel/examples/buttoncycler/buttoncycler.ino @@ -9,8 +9,12 @@ // driven with a pull-up resistor so the switch should // pull the pin to ground momentarily. On a high -> low // transition the button press logic will execute. - +#if _AVR_PINCOUNT == 14 +#define PIXEL_PIN PIN_PD4 // need to use a different pin on DD14 +#else #define PIXEL_PIN PIN_PA3 // Digital IO pin connected to the NeoPixels +#endif + #define PIXEL_COUNT 16 diff --git a/megaavr/libraries/tinyNeoPixel/examples/simple/simple.ino b/megaavr/libraries/tinyNeoPixel/examples/simple/simple.ino index b8620fb6..f8cd364f 100644 --- a/megaavr/libraries/tinyNeoPixel/examples/simple/simple.ino +++ b/megaavr/libraries/tinyNeoPixel/examples/simple/simple.ino @@ -5,7 +5,12 @@ // Which pin on the Arduino is connected to the NeoPixels? -#define PIN 3 +#if _AVR_PINCOUNT == 14 +#define PIXEL_PIN PIN_PD4 // need to use a different pin on DD14 +#else +#define PIXEL_PIN PIN_PA3 // Digital IO pin connected to the NeoPixels +#endif + // How many NeoPixels are attached to the Arduino? #define NUMPIXELS 16 diff --git a/megaavr/libraries/tinyNeoPixel/examples/strandtest/strandtest.ino b/megaavr/libraries/tinyNeoPixel/examples/strandtest/strandtest.ino index a9d9c423..6428f885 100644 --- a/megaavr/libraries/tinyNeoPixel/examples/strandtest/strandtest.ino +++ b/megaavr/libraries/tinyNeoPixel/examples/strandtest/strandtest.ino @@ -1,6 +1,6 @@ #include -#define PIN PIN_PC3 //For DxCore, the example uses PC1 whichexists on all parts +#define PIN PIN_PC1 //For DxCore, the example uses PC1 whichexists on all parts // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) diff --git a/megaavr/libraries/tinyNeoPixel_Static/examples/buttoncycler/buttoncycler.ino b/megaavr/libraries/tinyNeoPixel_Static/examples/buttoncycler/buttoncycler.ino index 173e3e0f..d479099f 100644 --- a/megaavr/libraries/tinyNeoPixel_Static/examples/buttoncycler/buttoncycler.ino +++ b/megaavr/libraries/tinyNeoPixel_Static/examples/buttoncycler/buttoncycler.ino @@ -10,7 +10,11 @@ // pull the pin to ground momentarily. On a high -> low // transition the button press logic will execute. +#if _AVR_PINCOUNT == 14 +#define PIXEL_PIN PIN_PD4 // need to use a different pin on DD14 +#else #define PIXEL_PIN PIN_PA3 // Digital IO pin connected to the NeoPixels +#endif #define PIXEL_COUNT 16 diff --git a/megaavr/libraries/tinyNeoPixel_Static/examples/simple/simple.ino b/megaavr/libraries/tinyNeoPixel_Static/examples/simple/simple.ino index 4b9cd09d..ef5ae9ac 100644 --- a/megaavr/libraries/tinyNeoPixel_Static/examples/simple/simple.ino +++ b/megaavr/libraries/tinyNeoPixel_Static/examples/simple/simple.ino @@ -5,7 +5,11 @@ // Which pin on the Arduino is connected to the NeoPixels? -#define PIN 3 +#if _AVR_PINCOUNT == 14 +#define PIXEL_PIN PIN_PD4 // need to use a different pin on DD14 +#else +#define PIXEL_PIN PIN_PA3 // Digital IO pin connected to the NeoPixels +#endif // How many NeoPixels are attached to the Arduino? #define NUMPIXELS 16 diff --git a/megaavr/libraries/tinyNeoPixel_Static/examples/strandtest/strandtest.ino b/megaavr/libraries/tinyNeoPixel_Static/examples/strandtest/strandtest.ino index cc8e7f99..fc34e087 100644 --- a/megaavr/libraries/tinyNeoPixel_Static/examples/strandtest/strandtest.ino +++ b/megaavr/libraries/tinyNeoPixel_Static/examples/strandtest/strandtest.ino @@ -1,6 +1,9 @@ #include - -#define PIN 3 +#if _AVR_PINCOUNT == 14 +#define PIN PIN_PD4 // need to use a different pin on DD14 +#else +#define PIN PIN_PA3 // Digital IO pin connected to the NeoPixels +#endif // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid)