Updated NeoPixelBus object (markdown)

Michael Miller
2018-05-13 19:56:51 -07:00
parent 2d1ed49dc1
commit a63f9fe635

@@ -74,136 +74,17 @@ Same as Neo800KbpsMethod but running at the older and slower data rate.
The NeoWs2813Method primarily expands the delay time to support these new chips. It is fully compatible with Ws2812 and some newer Ws2812b chips may require this method.
On the Esp8266 using this Method has a Pin restriction. Please review [NeoEsp8266DmaWs2813Method](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object#neoesp8266dmaws2813method) below for details.
## NeoEsp32BitBang800KbpsMethod
The NeoEsp32BitBang800KbpsMethod is the underlying method that gets used if you use Neo800KbpsMethod on Esp32 platforms. There should be no need to use it directly.
NeoEsp32BitBang800KbpsMethod supports any available pin below 32.
This method uses only the CPU to send data to the NeoPixels.
## NeoEsp32BitBang400KbpsMethod
Same as NeoEsp32BitBang800KbpsMethod but running at the older and slower data rate.
The NeoEsp32400KbpsMethod is the underlying method that gets used if you use Neo400KbpsMethod on Esp32 platforms. There should be no need to use it directly.
## NeoEsp32BitBangWs2813Method
Same as NeoEsp32BitBang800KbpsMethod but has the longer delay required these chips.
The NeoEsp32BitBangWs2813Method is the underlying method that gets used if you use NeoWs2813Method on Esp32 platforms. There should be no need to use it directly.
## NeoEsp8266Dma800KbpsMethod
The NeoEsp8266Dma800KbpsMethod is the underlying method that gets used if you use Neo800KbpsMethod on Esp8266 platforms. There should be no need to use it directly.
The NeoEsp8266Dma800KbpsMethod only supports the RDX0/GPIO3 pin. The Pin argument is omitted. See other esp8266 methods below if you don't have this pin available.
NOTE: Due to the varied board layouts for Esp8266, even though the pin maybe exposed, it may not be usable due to some custom feature on the board you use. If you find it not working, you should review the hardware schematic of your board and confirm the pin is not used for other purposes that interferes with it being used for NeoPixelBus.
This method uses very little CPU for actually sending the data to NeoPixels but it requires an extra buffer for the DMA to read from. Thus there is a trade off of CPU use versus memory use. The extra buffer needed is four times the size of the primary pixel buffer.
It also requires the use of the RDX0/GPIO3 pin. The normal feature of this pin is the "Serial" receive. Using this DMA method will not allow you to receive serial from the primary Serial object; but it will not stop you from sending output like this...
```
serial.println("I can still debug using serial println");
```
Due to the pin overlap, there are a few things to take into consideration.
First, when you are flashing the Esp8266, some LED types will react to the flashing and turn on. This is important if you have longer strips of pixels where the power use of full bright might exceed your design.
Second, the NeoPixelBus::Begin() MUST be called after the Serial.begin(). If they are called out of order, no pixel data will be sent as the Serial reconfigured the RDX0/GPIO3 pin to its needs.
For more details on Serial and pins, refer to the [Esp8266 Arduino Reference](http://esp8266.github.io/Arduino/versions/2.1.0/doc/reference.html)
_Thanks to g3gg0.de for porting the initial DMA support from the original which led to this work. The original was located at [github/cnlohr/esp8266ws2812i2s](https://github.com/cnlohr/esp8266ws2812i2s). The current work is no longer based on that but it gave me the direction I needed to provide a solution._
## NeoEsp8266Dma400KbpsMethod
Same as NeoEsp8266Dma800KbpsMethod but running at the older and slower data rate.
The NeoEsp8266Dma400KbpsMethod is the underlying method that gets used if you use Neo400KbpsMethod on Esp8266 platforms. There should be no need to use it directly.
## NeoEsp8266DmaWs2813Method
Same as NeoEsp8266Dma800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266Uart800KbpsMethod
NeoEsp8266Uart800KbpsMethod only supports the TXD1/GPIO2 pin. The Pin argument is omitted.
NOTE: Due to the varied board layouts for Esp8266, even though the pin maybe exposed, it may not be usable due to some custom feature on the board you use. If you find it not working, you should review the hardware schematic of your board and confirm the pin is not used for other purposes that interferes with it being used for NeoPixelBus.
This method uses the CPU to manage a small hardware managed UART buffer to send the data to the NeoPixels. Thus it requires more CPU overhead than the Dma method but it does NOT require an extra buffer.
If CPU cycles are an issue in your project, see NeoEsp8266AsyncUart800KbpsMethod below.
Due to using the TXD1/GPIO2 pin, the Serial1 object can not be used with the method and must be avoided. The primary serial object "Serial" is available for both read and write.
Use this instead of Neo800KbpsMethod to force your sketch to use the Uart to send data.
## NeoEsp8266Uart400KbpsMethod
Same as NeoEsp8266Uart800KbpsMethod but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Uart to send data.
## NeoEsp8266UartWs2813Method
Same as NeoEsp8266Uart800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266AsyncUart800KbpsMethod
NeoEsp8266AsyncUart800KbpsMethod only supports the TXD1/GPIO2 pin. The Pin argument is omitted.
**CAUTION:** With this method the `Pixels()` method will return alternating pointers after each call to `Show()`; so the pointer returned should not be cached or retained between calls of `Show()`.
NOTE: Due to the varied board layouts for Esp8266, even though the pin maybe exposed, it may not be usable due to some custom feature on the board you use. If you find it not working, you should review the hardware schematic of your board and confirm the pin is not used for other purposes that interferes with it being used for NeoPixelBus.
This method uses the UART interrupt to read from a secondary buffer to send the data to the NeoPixels. It requires very little CPU overhead but does require an extra buffer similar to the Dma method.
If memory is an issue for your project, see the NeoEsp8266Uart800KbpsMethod above.
_Thanks to unaiur for providing the implementation._
Due to using the TXD1/GPIO2 pin, the Serial1 object can not be used with the method and must be avoided. The primary serial object "Serial" is available for both read and write.
Use this instead of Neo800KbpsMethod to force your sketch to use the Uart to send data asynchronously.
## NeoEsp8266AsyncUart400KbpsMethod
Same as NeoEsp8266AsyncUart800KbpsMethod but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Uart to send data asynchronously.
## NeoEsp8266AsyncUartWs2813Method
Same as NeoEsp8266AsyncUart800KbpsMethod but using a longer delay as required by this chips.
## NeoEsp8266BitBang800KbpsMethod
NeoEsp8266BitBang800KbpsMethod supports any available pin between 0 and 15.
This method uses only the CPU to send data to the NeoPixels. But due to WiFi interrupts it is not stable when used with WiFi features of the Esp8266.
It is not recommended to use this method except for comparing results with the other methods. For very short runs of pixels (no more than about 3) it maybe possible to use this method without ill effects. If it fails, the pixels may not be correctly set.
Use this instead of Neo800KbpsMethod to force your sketch to use the Bit Banging to send data.
## NeoEsp8266BitBang400KbpsMethod
Same as NeoEsp8266BitBang800KbpsMethod but running at the older and slower data rate.
Use this instead of Neo400KbpsMethod to force your sketch to use the Bit Banging to send data.
## NeoEsp8266BitBangWs2813Method
Same as NeoEsp8266BitBang800KbpsMethod but using a longer delay as required by this chips.
## NeoAvr800KbpsMethod
The NeoAvr800KbpsMethod is the underlying method that gets used if you use Neo800KbpsMethod on AVR platforms. There should be no need to use it directly.
This work is directly taken from AdaFruit's NeoPixel library and all credit should go to them.
## NeoAvr400KbpsMethod
Same as NeoAvr800KbpsMethod but running at the older and slower data rate.
The NeoAvr400KbpsMethod is the underlying method that gets used if you use Neo400KbpsMethod on AVR platforms. There should be no need to use it directly.
This work is directly taken from AdaFruit's NeoPixel library and all credit should go to them.
## NeoAvrWs2813Method
Same as NeoAvr800KbpsMethod but using a longer delay as required by this chips.
The NeoAvrWs2813Method is the underlying method that gets used if you use NeoWs2813Method on AVR platforms. There should be no need to use it directly.
## NeoArm800KbpsMethod
The NeoArm800KbpsMethod is the underlying method that gets used if you use Neo800KbpsMethod on ARM platforms. There should be no need to use it directly.
This work is directly taken from AdaFruit's NeoPixel library and all credit should go to them.
## NeoArm400KbpsMethod
Same as NeoArm800KbpsMethod but running at the older and slower data rate.
The NeoArm400KbpsMethod is the underlying method that gets used if you use Neo400KbpsMethod on AVR platforms. There should be no need to use it directly.
This work is directly taken from AdaFruit's NeoPixel library and all credit should go to them.
## NeoArmWs2813Method
Same as NeoArm800KbpsMethod but using a longer delay as required by this chips.
The NeoArmWs2813Method is the underlying method that gets used if you use NeoWs2813Method on ARM platforms. There should be no need to use it directly.
## DotStarSpiMethod
This method should only be used with DotStar color features.
It will use the available hardware SPI support for the board you build with. The clock and data pins are not changeable for hardware support and thus the Pins argument is omitted.
The hardware pins on the board are often labeled as MOSI for data, and MSCLK or CLK for the clock.
## DotStarMethod
This method should only be used with DotStar color features. It will use two provided pins for clock and data to implement a software SPI.
This method should only be used with DotStar color features. It will use two provided pins for clock and data to implement a software SPI.
## Platform specific
In most cases the above should be all the methods you need to use. In a few cases, there are alternative methods that are useful to use on some platforms. Below are links to the platform specific methods.
* [Esp32 Platform specific methods](https://github.com/Makuna/NeoPixelBus/wiki/esp32neomethods)
* [Esp8266 Platform specific methods](https://github.com/Makuna/NeoPixelBus/wiki/esp8266neomethods)
* [AVR Platform specific methods](https://github.com/Makuna/NeoPixelBus/wiki/avrneomethods)
* [ARM Platform specific methods](https://github.com/Makuna/NeoPixelBus/wiki/armneomethods)