поискавой системы для электроныых деталей
  Russian  ▼
ALLDATASHEETRU.COM

X  

WS2812 датащи(PDF) 56 Page - Raspberry Pi Holdings PLC

номер детали WS2812
подробное описание детали  Created by Phillip Burgess
PDF  98 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
производитель  RASPBERRY-PI [Raspberry Pi Holdings PLC]
домашняя страница  https://www.raspberrypi.com/
Logo RASPBERRY-PI - Raspberry Pi Holdings PLC

WS2812 датащи(HTML) 56 Page - Raspberry Pi Holdings PLC

Back Button WS2812 Datasheet HTML 52Page - Raspberry Pi Holdings PLC 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 Next Button
Zoom Inzoom in Zoom Outzoom out
 56 / 98 page
background image
Then, in the setup() function, call begin() to prepare the data pin for NeoPixel output:
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
The second line, strip.show(), isn’t absolutely necessary, it’s just there to be thorough. That function pushes data out to
the pixels…since no colors have been set yet, this initializes all the NeoPixels to an initial “off” state in case some were
left lit by a prior program.
In the strandtest example, loop() doesn’t set any pixel colors on its own — it calls other functions that create animated
effects. So let’s ignore it for now and look ahead, inside the individual functions, to see how the strip is controlled.
There are a couple different ways to set the color of a pixel. The first is:
strip.setPixelColor(n, red, green, blue);
or, if you're using RGBW strips:
strip.setPixelColor(n, red, green, blue, white);
The first argument — n in this example — is the pixel number along the strip, starting from 0 closest to the Arduino. If
you have a strip of 30 pixels, they’re numbered 0 through 29. It’s a computer thing. You’ll see various places in the
code using a for loop, passing the loop counter variable as the pixel number to this function, to set the values of
multiple pixels.
The next three arguments are the pixel color, expressed as red, green and blue brightness levels, where 0 is dimmest
(off) and 255 is maximum brightness. The last
optional argument is for white, which will only be used if the strip was
defined during creation as an RGBW type and the strip actually is RGBW type.
To set the 12th pixel (#11, counting from 0) to magenta (red + blue), you could write:
strip.setPixelColor(11, 255, 0, 255);
to set the 8th pixel (#7 counting from 0) to half-brightness white (with an RGBW strip), with no light from red/green/blue,
use:
strip.setPixelColor(7, 0, 0, 0, 127);
An alternate syntax has just two arguments:
LEDs use NEO_RGBW (some RGBW strips use NEO_GRBW, so try that if you're getting unexpected results!)
The Adafruit Trinket 5V 16 MHz board requires a little extra setup. You can see the steps required in the
“strandtest” example sketch.
© Adafruit Industries
https://learn.adafruit.com/adafruit-neopixel-uberguide
Page 59 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


датащи скачать

Go To PDF Page


ссылки URL



Вашему бизинису помогли Аллдатащит?  [ DONATE ] 

Что такое Аллдатащит   |   реклама   |   контакт   |   Конфиденциальность   |   Ссылка на техническое описание    |   обмен ссыками   |   поиск по производителю
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