Skip to content

Commit

Permalink
docs/psoc6: Neopixel documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: IFX-Anusha <[email protected]>
  • Loading branch information
IFX-Anusha committed Aug 21, 2024
1 parent 93d3b04 commit 69b7a8c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/psoc6/quickref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,29 @@ The :mod:`machine` module::
bitstream('P13_6', 0, timing, buf) # bitstrem buffer data with timing through pin P13_6

.. note::
Bitstream is set for the CPU frequency of 100MHz. At other clock frequencies, the timing will not fit.
All timings greater than 1500 ns work and the accuracy of the timing is +/- 400 ns.
Supported timing_ns ranges below 1500 ns is [500, 1125, 800, 750].
Supported timing_ns ranges below 1500 ns is [500, 1125, 800, 750], [400, 850, 800, 450], [300, 900, 600, 600], [800, 1700, 1600, 900].

Neopixel driver
---------------

Neopixel library is supported in this port. The library can be installed using mip.

::
import mip
mip.install('neopixel')

neopixel driver can be used as follows. see the :mod:`neopixel` for more details.

::
import neopixel
from machine import Pin
p0 = Pin('P9_1', Pin.OUT, value=0) #set P9_1 to output to drive NeoPixels
np = neopixel.NeoPixel(p0,8,bpp=3) # create NeoPixel object on pin P9_1 with 8 pixels and 3 bytes per pixel with default timing=1
np[0] = (255, 255, 255) # set the first pixel to white
np.write() # write data to all pixels
Delay and timing
----------------

Expand Down

0 comments on commit 69b7a8c

Please sign in to comment.