|
12 | 12 | // These values depend on which pin your string is connected to and what board you are using
|
13 | 13 | // More info on how to find these at http://www.arduino.cc/en/Reference/PortManipulation
|
14 | 14 |
|
15 |
| -// These values are for digital pin 8 on an Arduino Yun or digital pin 12 on a DueMilinove/UNO |
| 15 | +// These values are for the pin that connects to the Data Input pin on the LED strip. They correspond to... |
| 16 | + |
| 17 | +// Arduino Yun: Digital Pin 8 |
| 18 | +// DueMilinove/UNO: Digital Pin 12 |
| 19 | +// Arduino MeagL PWM Pin 4 |
| 20 | + |
| 21 | +// You'll need to look up the port/bit combination for other boards. |
| 22 | + |
16 | 23 | // Note that you could also include the DigitalWriteFast header file to not need to to this lookup.
|
17 | 24 |
|
18 | 25 | #define PIXEL_PORT PORTB // Port of the pin the pixels are connected to
|
|
43 | 50 | // Actually send a bit to the string. We must to drop to asm to enusre that the complier does
|
44 | 51 | // not reorder things and make it so the delay happens in the wrong place.
|
45 | 52 |
|
46 |
| -void sendBit( bool bitVal ) { |
| 53 | +inline void sendBit( bool bitVal ) { |
47 | 54 |
|
48 | 55 | if ( bitVal ) { // 0 bit
|
49 | 56 |
|
@@ -98,7 +105,7 @@ void sendBit( bool bitVal ) {
|
98 | 105 | }
|
99 | 106 |
|
100 | 107 |
|
101 |
| -void sendByte( unsigned char byte ) { |
| 108 | +inline void sendByte( unsigned char byte ) { |
102 | 109 |
|
103 | 110 | for( unsigned char bit = 0 ; bit < 8 ; bit++ ) {
|
104 | 111 |
|
@@ -128,7 +135,7 @@ void ledsetup() {
|
128 | 135 |
|
129 | 136 | }
|
130 | 137 |
|
131 |
| -void sendPixel( unsigned char r, unsigned char g , unsigned char b ) { |
| 138 | +inline void sendPixel( unsigned char r, unsigned char g , unsigned char b ) { |
132 | 139 |
|
133 | 140 | sendByte(g); // Neopixel wants colors in green then red then blue order
|
134 | 141 | sendByte(r);
|
@@ -332,13 +339,13 @@ void detonate( unsigned char r , unsigned char g , unsigned char b , unsigned in
|
332 | 339 |
|
333 | 340 | void setup() {
|
334 | 341 |
|
335 |
| - ledsetup(); |
| 342 | + ledsetup(); |
336 | 343 |
|
337 | 344 | }
|
338 | 345 |
|
339 | 346 |
|
340 | 347 | void loop() {
|
341 |
| - |
| 348 | + |
342 | 349 | // Some example procedures showing how to display to the pixels:
|
343 | 350 | colorWipe(255, 0, 0, 0); // Red
|
344 | 351 | colorWipe(0, 255, 0, 0); // Green
|
|
0 commit comments