Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

WS2812 Scheda tecnica(PDF) 57 Page - Raspberry Pi Holdings PLC

Il numero della parte WS2812
Spiegazioni elettronici  Created by Phillip Burgess
PDF  98 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  RASPBERRY-PI [Raspberry Pi Holdings PLC]
Homepage  https://www.raspberrypi.com/
Logo RASPBERRY-PI - Raspberry Pi Holdings PLC

WS2812 Scheda tecnica(HTML) 57 Page - Raspberry Pi Holdings PLC

Back Button WS2812 Datasheet HTML 53Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 54Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 55Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 56Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 57Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 58Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 59Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 60Page - Raspberry Pi Holdings PLC WS2812 Datasheet HTML 61Page - Raspberry Pi Holdings PLC Next Button
Zoom Inzoom in Zoom Outzoom out
 57 / 98 page
background image
strip.setPixelColor(n, color);
Here, color is a 32-bit type that merges the red, green and blue values into a single number. This is sometimes easier
or faster for some (but not all) programs to work with; you’ll see the strandtest code uses both syntaxes in different
places.
You can also convert separate red, green and blue values into a single 32-bit type for later use:
uint32_t magenta = strip.Color(255, 0, 255);
Then later you can just pass “magenta” as an argument to setPixelColor rather than the separate red, green and blue
numbers every time.
You can also (optionally) add a white component to the color at the end, like this:
uint32_t greenishwhite = strip.Color(0, 64, 0, 64);
setPixelColor() does not have an immediate effect on the LEDs. To “push” the color data to the strip, callshow():
strip.show();
This updates the whole strip at once, and despite the extra step is actually a good thing. If every call to setPixelColor()
had an immediate effect, animation would appear jumpy rather than buttery smooth.
Multiple pixels can be set to the same color using the fill() function, which accepts one to three arguments. Typically it’s
called like this:
strip.fill(color, first, count);
“color” is a packed 32-bit RGB (or RGBW) color value, as might be returned by strip.Color(). There is no option here for
separate red, green and blue, so call the Color() function to pack these into one value.
“first” is the index of the first pixel to fill, where 0 is the first pixel in the strip, and strip.numPixels() - 1 is the last. Must be
a positive value or 0.
“count” is the number of pixels to fill. Must be a positive value.
If called without a
count argument (only color and first), this will from first to the end of the strip.
If called without
first or count arguments (only color), the full strip will be set to the requested color.
If called with
no arguments, the strip will be filled with black or “off,” but there’s also a different syntax which might be
easier to read:
strip.clear();
You can query the color of a previously-set pixel using getPixelColor():
© Adafruit Industries
https://learn.adafruit.com/adafruit-neopixel-uberguide
Page 60 of 101



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98


Scheda tecnica Scarica

Go To PDF Page


Link URL



Lei ha avuto il aiuto da alldatasheet?  [ DONATE ] 

Di alldatasheet   |   Richest di pubblicita   |   contatti   |   Privacy Policy   |   Collegamento alla scheda tecnica    |   scambio Link   |   Ricerca produttore
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com