Skip to content

Commit aec6460

Browse files
authored
Merge pull request #24 from adafruit/develop
change all neopixel color
2 parents 1a2b141 + 6bbcc87 commit aec6460

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

examples/WebUSB/webusb_rgb/webusb_rgb.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#endif
3939

4040
// How many NeoPixels are attached to the Arduino?
41-
#define NUMPIXELS 1
41+
#define NUMPIXELS 10
4242

4343
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
4444
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
@@ -63,7 +63,7 @@ void setup()
6363
// This initializes the NeoPixel with RED
6464
pixels.begin();
6565
pixels.setBrightness(50);
66-
pixels.setPixelColor(0, 0xff0000);
66+
pixels.fill(0xff0000);
6767
pixels.show();
6868

6969
// wait until device mounted
@@ -95,14 +95,15 @@ void loop()
9595
uint8_t red = 16*char2num(input[1]) + char2num(input[2]);
9696
uint8_t green = 16*char2num(input[3]) + char2num(input[4]);
9797
uint8_t blue = 16*char2num(input[5]) + char2num(input[6]);
98-
99-
pixels.setPixelColor(0, red, green, blue);
98+
99+
uint32_t color = (red << 16) | (green << 8) | blue;
100+
pixels.fill(color);
100101
pixels.show();
101102
}
102103

103104
void line_state_callback(bool connected)
104105
{
105106
// connected = green, disconnected = red
106-
pixels.setPixelColor(0, connected ? 0x00ff00 : 0xff0000);
107+
pixels.fill(connected ? 0x00ff00 : 0xff0000);
107108
pixels.show();
108109
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit TinyUSB Library
2-
version=0.5.0
2+
version=0.6.0
33
author=Adafruit
44
maintainer=Adafruit <info@adafruit.com>
55
sentence=TinyUSB library for Arduino

0 commit comments

Comments
 (0)