0% found this document useful (0 votes)
15K views1 page

Neopixels For Attiny85

A small example file that demonstrates the use of neopixels with an Attiny85 processor using the Adafruit Library.

Uploaded by

lvolders4833
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15K views1 page

Neopixels For Attiny85

A small example file that demonstrates the use of neopixels with an Attiny85 processor using the Adafruit Library.

Uploaded by

lvolders4833
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson

// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel l
ibrary
// Adapted for the Attiny85 by Luc Volders
// First we set all leds to blue
// next one led will change from blue to red and back to blue
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
// The neopixels will be attached to pin 1
#define PIN
1
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS
7
// When we setup the NeoPixel library, we tell it how many pixels, and which pin
to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parame
ter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ80
0);
int delayval = 500; // delay for half a second
void setup() {
randomSeed(analogRead(0));
pixels.begin(); // This initializes the NeoPixel library.
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, 0,0,255);
pixels.show();
delay(delayval*2);
}
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up t
o the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, 255,0,0);
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
pixels.setPixelColor(i, 0,0,255);
delay(delayval);
}
}

You might also like