#define LED PB1
#define IRREC PB2
#define BT1 PB0
#include <IRremote.hpp>
#include <Adafruit_NeoPixel.h>
#define PIN PB3 // input pin Neopixel is attached to
#define NUMPIXELS 16 // number of neopixels in strip
Adafruit_NeoPixel cinta = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 1000; // timing delay in milliseconds
void setup() {
pinMode(BT1, INPUT_PULLUP);
pinMode(LED, OUTPUT);
IrReceiver.begin(IRREC); //inicinializa el IR receiver
// Initialize the NeoPixel library.
cinta.begin();
cinta.setBrightness(200);
cinta.show(); // Initialize all pixels to 'off'
}
void loop() {
int code = IrReceiver.decodedIRData.decodedRawData;
if (IrReceiver.decode()) {
IrReceiver.resume();
delay(10);
}
// put your main code here, to run repeatedly:
for (int i=0; i < NUMPIXELS; i++) {
cinta.setPixelColor(i, 25, 200,250 );
// This sends the updated pixel color to the hardware.
cinta.show();
delay(delayval);
}
cinta.clear();
// Delay for a period of time (in milliseconds).
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
// can't find a good lib
}