Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Makuna/NeoPixelBus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.5.1
Choose a base ref
...
head repository: Makuna/NeoPixelBus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 25,922 additions and 5,470 deletions.
  1. +4 −0 .github/FUNDING.yml
  2. +15 −0 .github/ISSUE_TEMPLATE/all-others.md
  3. +3 −0 .github/ISSUE_TEMPLATE/bug_report.md
  4. +3 −0 .github/ISSUE_TEMPLATE/feature_request.md
  5. +7 −12 ReadMe.md
  6. +160 −0 examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino
  7. +167 −0 examples/ESP32/DotStarTest_Esp32DmaSpi/DotStarTest_Esp32DmaSpi.ino
  8. +55 −0 examples/ESP32/NeoPixel_ESP32_I2sParallel/NeoPixel_ESP32_I2sParallel.ino
  9. +55 −0 examples/ESP32/NeoPixel_ESP32_LcdParallel/NeoPixel_ESP32_LcdParallel.ino
  10. +84 −0 examples/Hd108Test/Hd108Test.ino
  11. +0 −83 examples/NeoPixelBrightness/NeoPixelBrightness.ino
  12. +108 −0 examples/NeoPixelBusLg/NeoPixelBusLg.ino
  13. +88 −0 examples/NeoPixelParallel/NeoPixelParallel.ino
  14. +15 −15 examples/NeoPixelTest/NeoPixelTest.ino
  15. +78 −0 examples/PixieSerial/PixieSerial.ino
  16. +56 −0 examples/RP2040/NeoPixel_RP2040_PioX4/NeoPixel_RP2040_PioX4.ino
  17. +5 −5 examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino
  18. +3 −3 examples/animations/NeoPixelCylon/NeoPixelCylon.ino
  19. +3 −3 examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino
  20. +1 −1 examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino
  21. +2 −2 examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino
  22. +2 −2 examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino
  23. +2 −2 examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino
  24. +2 −2 examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino
  25. +2 −2 examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino
  26. +1 −1 examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino
  27. +3 −3 examples/{ → gamma}/NeoPixelGamma/NeoPixelGamma.ino
  28. +103 −0 examples/gamma/NeoPixelGammaDynamic/NeoPixelGammaDynamic.ino
  29. +36 −0 examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino
  30. +144 −0 examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino
  31. +7 −4 examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino
  32. +2 −2 examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino
  33. +122 −0 examples/topologies/NeoPixelRingDynamicTopologyTest/NeoPixelRingDynamicTopologyTest.ino
  34. +6 −2 examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino
  35. +7 −4 examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino
  36. +4 −4 examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino
  37. +7 −4 examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino
  38. +4 −4 examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino
  39. +26 −0 extras/debug/esp32/I2sDump/I2sDump.ino
  40. +600 −1 keywords.txt
  41. +16 −11 library.json
  42. +4 −4 library.properties
  43. +3 −4 src/NeoPixelAnimator.h
  44. +58 −55 src/NeoPixelBrightnessBus.h
  45. +118 −85 src/NeoPixelBus.h
  46. +203 −0 src/NeoPixelBusLg.h
  47. +67 −0 src/NeoPixelSegmentBus.h
  48. +0 −655 src/internal/DotStarColorFeatures.h
  49. +0 −133 src/internal/DotStarSpiMethod.h
  50. +0 −484 src/internal/Esp32_i2s.c
  51. +0 −40 src/internal/Esp32_i2s.h
  52. +0 −426 src/internal/Layouts.h
  53. +0 −214 src/internal/NeoAvrMethod.h
  54. +40 −0 src/internal/NeoBuffers.h
  55. +44 −0 src/internal/NeoBusChannel.h
  56. +63 −363 src/internal/NeoColorFeatures.h
  57. +58 −0 src/internal/NeoColors.h
  58. +0 −217 src/internal/NeoEsp32I2sMethod.h
  59. +0 −370 src/internal/NeoEsp32RmtMethod.h
  60. +0 −460 src/internal/NeoEsp8266DmaMethod.h
  61. +0 −431 src/internal/NeoEsp8266UartMethod.h
  62. +0 −195 src/internal/NeoEspBitBangMethod.h
  63. +89 −0 src/internal/NeoMethods.h
  64. +0 −170 src/internal/NeoPixelEsp.c
  65. +182 −0 src/internal/NeoSettings.h
  66. +39 −0 src/internal/NeoTopologies.h
  67. +128 −0 src/internal/NeoUtil.h
  68. +0 −249 src/internal/RgbColor.cpp
  69. +0 −148 src/internal/RgbColor.h
  70. +216 −0 src/internal/XMethods.h
  71. +28 −16 src/internal/{ → animations}/NeoEase.h
  72. +3 −1 src/internal/{ → animations}/NeoPixelAnimator.cpp
  73. +41 −0 src/internal/buffers/LayoutMapCallback.h
  74. +10 −7 src/internal/{ → buffers}/NeoBitmapFile.h
  75. +23 −16 src/internal/{ → buffers}/NeoBuffer.h
  76. +2 −2 src/internal/{ → buffers}/NeoBufferContext.h
  77. +5 −115 src/internal/{ → buffers}/NeoBufferMethods.h
  78. +126 −0 src/internal/buffers/NeoBufferProgmemMethod.h
  79. +33 −58 src/internal/{ → buffers}/NeoDib.h
  80. +53 −0 src/internal/buffers/NeoShaderBase.h
  81. +53 −0 src/internal/buffers/NeoShaderNop.h
  82. +8 −5 src/internal/{NeoSpriteSheet.h → buffers/NeoVerticalSpriteSheet.h}
  83. +31 −13 src/internal/{ → colors}/HsbColor.cpp
  84. +9 −3 src/internal/{ → colors}/HsbColor.h
  85. +29 −11 src/internal/{ → colors}/HslColor.cpp
  86. +10 −3 src/internal/{ → colors}/HslColor.h
  87. +20 −15 src/internal/{ → colors}/HtmlColor.cpp
  88. +4 −9 src/internal/{ → colors}/HtmlColor.h
  89. +2 −1 src/internal/{ → colors}/HtmlColorNameStrings.cpp
  90. +1 −3 src/internal/{ → colors}/HtmlColorNameStrings.h
  91. +7 −1 src/internal/{ → colors}/HtmlColorNames.cpp
  92. +7 −1 src/internal/{ → colors}/HtmlColorShortNames.cpp
  93. +100 −0 src/internal/colors/NeoGamma.h
  94. +41 −0 src/internal/colors/NeoGammaCieLabEquationMethod.h
  95. +34 −0 src/internal/colors/NeoGammaDynamicTableMethod.cpp
  96. +226 −0 src/internal/colors/NeoGammaDynamicTableMethod.h
  97. +5 −35 src/internal/{NeoGamma.h → colors/NeoGammaEquationMethod.h}
  98. +48 −0 src/internal/colors/NeoGammaInvertMethod.h
  99. +42 −0 src/internal/colors/NeoGammaNullMethod.h
  100. +20 −22 src/internal/{NeoGamma.cpp → colors/NeoGammaTableMethod.cpp}
  101. +113 −0 src/internal/colors/NeoGammaTableMethod.h
  102. +1 −1 src/internal/{ → colors}/NeoHueBlend.h
  103. +315 −0 src/internal/colors/Rgb16Color.h
  104. +178 −0 src/internal/colors/Rgb48Color.cpp
  105. +314 −0 src/internal/colors/Rgb48Color.h
  106. +236 −0 src/internal/colors/RgbColor.cpp
  107. +304 −0 src/internal/colors/RgbColor.h
  108. +136 −0 src/internal/colors/RgbColorBase.cpp
  109. +69 −0 src/internal/colors/RgbColorBase.h
  110. +38 −0 src/internal/colors/RgbColorIndexes.h
  111. +190 −0 src/internal/colors/Rgbw64Color.cpp
  112. +348 −0 src/internal/colors/Rgbw64Color.h
  113. +66 −6 src/internal/{ → colors}/RgbwColor.cpp
  114. +152 −5 src/internal/{ → colors}/RgbwColor.h
  115. +220 −0 src/internal/colors/Rgbww80Color.cpp
  116. +364 −0 src/internal/colors/Rgbww80Color.h
  117. +229 −0 src/internal/colors/RgbwwColor.cpp
  118. +325 −0 src/internal/colors/RgbwwColor.h
  119. +253 −0 src/internal/colors/RgbwwwColor.cpp
  120. +367 −0 src/internal/colors/RgbwwwColor.h
  121. +201 −0 src/internal/colors/SegmentDigit.cpp
  122. +325 −0 src/internal/colors/SegmentDigit.h
  123. +70 −0 src/internal/features/DotStarL4ByteFeature.h
  124. +89 −0 src/internal/features/DotStarL4WordFeature.h
  125. +83 −0 src/internal/features/DotStarLrgbFeatures.h
  126. +84 −0 src/internal/features/DotStarRgbFeatures.h
  127. +70 −0 src/internal/features/DotStarX4ByteFeature.h
  128. +83 −0 src/internal/features/DotStarX4WordFeature.h
  129. +52 −0 src/internal/features/Lpd6803RgbFeatures.h
  130. +39 −0 src/internal/features/Lpd8806RgbFeatures.h
  131. +89 −0 src/internal/features/Neo2Byte555Feature.h
  132. +67 −0 src/internal/features/Neo3Byte777Feature.h
  133. +67 −0 src/internal/features/Neo3ByteFeature.h
  134. +77 −0 src/internal/features/Neo3WordFeature.h
  135. +69 −0 src/internal/features/Neo4ByteFeature.h
  136. +82 −0 src/internal/features/Neo4WordFeature.h
  137. +72 −0 src/internal/features/Neo5ByteFeature.h
  138. +87 −0 src/internal/features/Neo5WordFeature.h
  139. +75 −0 src/internal/features/Neo6ByteFeature.h
  140. +76 −0 src/internal/features/Neo6xByteFeature.h
  141. +73 −0 src/internal/features/Neo6xxByteFeature.h
  142. +72 −0 src/internal/features/NeoAbcdefgpsSegmentFeature.h
  143. +93 −0 src/internal/features/NeoBacedfpgsSegmentFeature.h
  144. +139 −0 src/internal/features/NeoByteElements.h
  145. +48 −0 src/internal/features/NeoElementsNoSettings.h
  146. +63 −0 src/internal/features/NeoRgb48Features.h
  147. +64 −0 src/internal/features/NeoRgbFeatures.h
  148. +33 −0 src/internal/features/NeoRgbcwxFeatures.h
  149. +66 −0 src/internal/features/NeoRgbw64Features.h
  150. +69 −0 src/internal/features/NeoRgbwFeatures.h
  151. +39 −0 src/internal/features/NeoRgbww80Features.h
  152. +63 −0 src/internal/features/NeoRgbwwFeatures.h
  153. +33 −0 src/internal/features/NeoRgbwwwFeatures.h
  154. +33 −0 src/internal/features/NeoRgbwxxFeatures.h
  155. +161 −0 src/internal/features/NeoSm168x3Features.h
  156. +174 −0 src/internal/features/NeoSm168x4Features.h
  157. +161 −0 src/internal/features/NeoSm168x5Features.h
  158. +103 −0 src/internal/features/NeoTm1814Features.h
  159. +113 −0 src/internal/features/NeoTm1914Features.h
  160. +77 −0 src/internal/features/P9813BgrFeature.h
  161. +180 −0 src/internal/features/Tlc59711RgbFeatures.h
  162. +337 −0 src/internal/methods/DotStarEsp32DmaSpiMethod.h
  163. +181 −0 src/internal/methods/DotStarGenericMethod.h
  164. +955 −0 src/internal/methods/Esp32_i2s.c
  165. +72 −0 src/internal/methods/Esp32_i2s.h
  166. +159 −0 src/internal/methods/FractionClk.c
  167. +23 −0 src/internal/methods/FractionClk.h
  168. +171 −0 src/internal/methods/Hd108GenericMethod.h
  169. +154 −0 src/internal/methods/Lpd6803GenericMethod.h
  170. +154 −0 src/internal/methods/Lpd8806GenericMethod.h
  171. +212 −0 src/internal/methods/Mbi6033GenericMethod.h
  172. +227 −59 src/internal/{ → methods}/NeoArmMethod.h
  173. +362 −0 src/internal/methods/NeoAvrMethod.h
  174. +112 −0 src/internal/methods/NeoBits.h
  175. +459 −0 src/internal/methods/NeoEsp32I2sMethod.h
  176. +1,091 −0 src/internal/methods/NeoEsp32I2sXMethod.h
  177. +766 −0 src/internal/methods/NeoEsp32LcdXMethod.h
  178. +376 −0 src/internal/methods/NeoEsp32RmtMethod.cpp
  179. +1,073 −0 src/internal/methods/NeoEsp32RmtMethod.h
  180. +378 −0 src/internal/methods/NeoEsp8266DmaMethod.h
  181. +357 −0 src/internal/methods/NeoEsp8266I2sDmx512Method.h
  182. +35 −0 src/internal/methods/NeoEsp8266I2sMethodCore.cpp
  183. +396 −0 src/internal/methods/NeoEsp8266I2sMethodCore.h
  184. +14 −9 src/internal/{ → methods}/NeoEsp8266UartMethod.cpp
  185. +606 −0 src/internal/methods/NeoEsp8266UartMethod.h
  186. +238 −0 src/internal/methods/NeoEspBitBangMethod.cpp
  187. +487 −0 src/internal/methods/NeoEspBitBangMethod.h
  188. +735 −0 src/internal/methods/NeoNrf52xMethod.h
  189. +167 −28 src/internal/{ → methods}/NeoPixelAvr.c
  190. +150 −0 src/internal/methods/P9813GenericMethod.h
  191. +114 −0 src/internal/methods/PixieStreamMethod.h
  192. +175 −0 src/internal/methods/Rp2040/NeoRp2040DmaState.h
  193. +82 −0 src/internal/methods/Rp2040/NeoRp2040PioInstance.h
  194. +77 −0 src/internal/methods/Rp2040/NeoRp2040PioMonoProgram.cpp
  195. +223 −0 src/internal/methods/Rp2040/NeoRp2040PioMonoProgram.h
  196. +120 −0 src/internal/methods/Rp2040/NeoRp2040PioSpeed.h
  197. +487 −0 src/internal/methods/Rp2040/NeoRp2040x4Method.h
  198. +143 −0 src/internal/methods/Sm16716GenericMethod.h
  199. +225 −0 src/internal/methods/Tlc5947GenericMethod.h
  200. +228 −0 src/internal/methods/Tlc59711GenericMethod.h
  201. +38 −56 src/internal/{DotStarGenericMethod.h → methods/TwoWireBitBangImple.h}
  202. +52 −65 src/internal/{DotStarAvrMethod.h → methods/TwoWireBitBangImpleAvr.h}
  203. +209 −0 src/internal/methods/TwoWireDebugImple.h
  204. +92 −0 src/internal/methods/TwoWireHspiImple.h
  205. +226 −0 src/internal/methods/TwoWireSpiImple.h
  206. +156 −0 src/internal/methods/Ws2801GenericMethod.h
  207. +144 −0 src/internal/topologies/ColumnMajorAlternatingLayout.h
  208. +104 −0 src/internal/topologies/ColumnMajorLayout.h
  209. +13 −7 src/internal/{ → topologies}/NeoMosaic.h
  210. +24 −10 src/internal/{ → topologies}/NeoRingTopology.h
  211. +11 −7 src/internal/{ → topologies}/NeoTiles.h
  212. +12 −5 src/internal/{ → topologies}/NeoTopology.h
  213. +144 −0 src/internal/topologies/RowMajorAlternatingLayout.h
  214. +103 −0 src/internal/topologies/RowMajorLayout.h
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [makuna]
custom: ["https://paypal.me/MakunaGithub"]
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/all-others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: All others
about: If your issue doesn't fit the other two, this will guide you to support.
title: "[DELETE ME]"
labels: NOT AN ISSUE
assignees: ''

---

### STOP
If you are seeking support, then please use the Discussions feature or gitter channel by following one of these links.
[NeoPixelBus Discussions](https://github.com/Makuna/NeoPixelBus/discussions)
[NeoPixelBus Gitter Channel](https://gitter.im/Makuna/NeoPixelBus)

If you submit issues that are not traceable bugs or feature requests, it will just get closed.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

19 changes: 7 additions & 12 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -4,26 +4,21 @@

Arduino NeoPixel library

A library to control one wire protocol RGB and RGBW leds like APA106, SK6812, WS2811, WS2812 and WS2813 that are commonly refered to as NeoPixels and two wire protocol RGB like APA102 commonly refered to as DotStars.
A library to control one wire protocol RGB, RGBW, and RGBWW leds like APA106, SK6812, WS2811, WS2812 and WS2813 that are commonly refered to as NeoPixels and two wire protocol RGB like Lpd8806, APA102 and SK9822 commonly refered to as DotStars.
Supports most Arduino platforms.
This is the most functional library for the Esp8266 as it provides solutions for all Esp8266 module types even when WiFi is used.


Please read this best practices link before connecting your NeoPixels, it will save you a lot of time and effort.
[Adafruit NeoPixel Best Practices](https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices)

For quick questions jump on Gitter and ask away.
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Makuna/NeoPixelBus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
For quick questions and support:
* [Try the new Github Discussions](https://github.com/Makuna/NeoPixelBus/discussions)
* [Discord NeoPixelBus Invitation](https://discord.gg/c6FrysvZyV) or if you are already a member of [Discord Server NeoPixelBus](https://discord.com/channels/789177382221119519/789177382221119521)
* Or jump on Gitter
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Makuna/NeoPixelBus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

For bugs, make sure there isn't an active issue and then create one.

## Why this library and not FastLED or some other library?
See [Why this Library in the Wiki](https://github.com/Makuna/NeoPixelBus/wiki/Library-Comparisons).

## Documentation
[See Wiki](https://github.com/Makuna/NeoPixelBus/wiki)

## Installing This Library (prefered, you just want to use it)
## Installing This Library (preferred, you just want to use it)
Open the Library Manager and search for "NeoPixelBus by Makuna" and install

## Installing This Library From GitHub (advanced, you want to contribute)
160 changes: 160 additions & 0 deletions examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
// DotStarTest_Esp32Advanced - This example only works on the ESP32
// This example will cycle between showing four pixels as Red, Green, Blue, White
// and then showing those pixels as Black. This example uses Hardware SPI on the ESP32
// with options to use alternate pins for SPI and drive two SPI ports using the alternate
// additional SPI hardware available on the ESP32.
//
// There is serial output of the current state so you can confirm and follow along
//

#include <NeoPixelBus.h>

#define USE_DEFAULT_SPI_PORT 1
#define USE_ALTERNATE_SPI_PORT 1

#if (USE_DEFAULT_SPI_PORT == 1)
const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure

// It's usually better to use alternate pins. If set to false, strip will use GPIO 18 for Clock, GPIO 23 for Data, and pin 5 will output a chip select signal
const bool useSpiAlternatePins = true;

// If you set useSpiAlternatePins true, then these pins will be used instead. Any output-capable GPIO can be used.
const uint8_t DotClockPin = 18;
const uint8_t DotDataPin = 23;
const uint8_t MisoUnusedPin = -1;
const int8_t DotChipSelectPin = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins=false

// for software bit bang (only use if neither SPI peripheral is available)
//NeoPixelBus<DotStarBgrFeature, DotStarMethod> strip(PixelCount, DotClockPin, DotDataPin);

// for hardware SPI (best performance) with default SPI peripheral
NeoPixelBus<DotStarBgrFeature, DotStarSpiMethod> strip(PixelCount);

// DotStarSpiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarSpi2MhzMethod" (see wiki for more details)

// to change the SPI clock speed during runtime, use the "Hz" clock setting, e.g. DotStarSpiHzMethod, which default to 10MHz but supports updating during runtime
//NeoPixelBus<DotStarBgrFeature, DotStarSpiHzMethod> strip(PixelCount);
//#define SET_CLOCK_SPEED_DURING_RUNTIME // only define if using "Hz" clock method

#endif

#if (USE_ALTERNATE_SPI_PORT == 1)
const uint16_t PixelCount2 = 4; // this example assumes 4 pixels, making it smaller will cause a failure

// It's usually better to use alternate pins. If set to false, strip2 will use GPIO 14 for Clock, GPIO 13 for Data, and pin 15 will output a chip select signal
const bool useSpiAlternatePins2 = true;

// If you set useSpiAlternatePins2 true, then these pins will be used instead. Any output-capable GPIO can be used.
const uint8_t DotClockPin2 = 14;
const uint8_t DotDataPin2 = 13;
const int8_t DotChipSelectPin2 = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins2=false

// for hardware SPI (best performance) with alternate SPI peripheral
NeoPixelBus<DotStarBgrFeature, DotStarHspiMethod> strip2(PixelCount2);

// DotStarHspiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarHspi2MhzMethod" (see wiki for more details)
#endif

#define colorSaturation 128

// Note that both DotStarSpiMethod and DotStarHspiMethod can be used with DotStarLbgrFeature and DotStarWbgrFeature but to keep things simple those are excluded from this example, see DotStarTest for more details

RgbColor red(colorSaturation, 0, 0);
RgbColor green(0, colorSaturation, 0);
RgbColor blue(0, 0, colorSaturation);
RgbColor white(colorSaturation);
RgbColor black(0);

void setup()
{
Serial.begin(115200);
while (!Serial); // wait for serial attach

Serial.println();
Serial.println("Initializing...");
Serial.flush();

#if (USE_DEFAULT_SPI_PORT == 1)
if (useSpiAlternatePins)
{
strip.Begin(DotClockPin, MisoUnusedPin, DotDataPin, DotChipSelectPin);
}
else
{
strip.Begin();
}

strip.ClearTo(black); // this resets all the DotStars to an off state
strip.Show();
#endif

#if (USE_ALTERNATE_SPI_PORT == 1)
if (useSpiAlternatePins2)
{
strip2.Begin(DotClockPin2, MisoUnusedPin, DotDataPin2, DotChipSelectPin2);
}
else
{
strip2.Begin();
}

strip2.ClearTo(black); // this resets all the DotStars to an off state
strip2.Show();
#endif

Serial.println();
Serial.println("Running...");
}


void loop()
{
delay(5000);

#if (USE_DEFAULT_SPI_PORT == 1)
Serial.println("Default SPI Colors R, G, B, W...");
// set the colors,
strip.SetPixelColor(0, red);
strip.SetPixelColor(1, green);
strip.SetPixelColor(2, blue);
strip.SetPixelColor(3, white);
strip.Show();
#endif

#if (USE_ALTERNATE_SPI_PORT == 1)
Serial.println("Alt SPI Colors W, B, G, R...");
// set the colors,
strip2.SetPixelColor(0, white);
strip2.SetPixelColor(1, blue);
strip2.SetPixelColor(2, green);
strip2.SetPixelColor(3, red);
strip2.Show();
#endif

delay(5000);

Serial.println("Off ...");

#if (USE_DEFAULT_SPI_PORT == 1)
#ifdef SET_CLOCK_SPEED_DURING_RUNTIME
uint32_t clockspeed = 5000000UL;
strip.SetMethodSettings(NeoSpiSettings(clockspeed));
#endif

// turn off the pixels
strip.SetPixelColor(0, black);
strip.SetPixelColor(1, black);
strip.SetPixelColor(2, black);
strip.SetPixelColor(3, black);
strip.Show();
#endif

#if (USE_ALTERNATE_SPI_PORT == 1)
// turn off the pixels
strip2.SetPixelColor(0, black);
strip2.SetPixelColor(1, black);
strip2.SetPixelColor(2, black);
strip2.SetPixelColor(3, black);
strip2.Show();
#endif
}
Loading