//Original code by NeoPixel Ring simple sketch (c) 2013 Shae Erisson and IR Remote SimpleReciever Example (c) 2020-2023 Armin Joachimsmeyer // Modified by Claire Chaikin-Bryan 2023 #include /* * This include defines the actual pin number for pins like IR_RECEIVE_PIN, IR_SEND_PIN for many different boards and architectures */ #include "PinDefinitionsAndMore.h" #include // include the library #include #ifdef __AVR__ #include // Required for 16 MHz Adafruit Trinket #endif // Which pin on the Arduino is connected to the NeoPixels? #define PIN 6 // On Trinket or Gemma, suggest changing this to 1 // How many NeoPixels are attached to the Arduino? #define NUMPIXELS 12// Popular NeoPixel ring size // When setting up 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 parameter -- see the // strandtest example for more information on possible values. Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); #define DELAYVAL 500 // Time (in milliseconds) to pause between pixels void setup(){ Serial.begin(9600); //irrecv.enableIRIn(); // irrecv.blink13(true); // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. // Any other board, you can remove this part (but no harm leaving it): #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif // END of Trinket-specific code. pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) // Just to know which program is running on my Arduino // Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE)); // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Serial.print(F("Ready to receive IR signals of protocols: ")); // printActiveIRProtocols(&Serial); // Serial.println(F("at pin " STR(IR_RECEIVE_PIN))); } void loop(){ if (IrReceiver.decode()) { /* * Print a short summary of received data */ // IrReceiver.printIRResultShort(&Serial); // IrReceiver.printIRSendUsage(&Serial); if (IrReceiver.decodedIRData.protocol == UNKNOWN) { Serial.println(F("Received noise or an unknown (or not yet enabled) protocol")); // We have an unknown protocol here, print more info // IrReceiver.printIRResultRawFormatted(&Serial, true); } // Serial.println(); /* * !!!Important!!! Enable receiving of the next value, * since receiving has stopped after the end of the current received data packet. */ IrReceiver.resume(); // Enable receiving of the next value } if (IrReceiver.decodedIRData.command == 74) { // case 0xFF52AD: //Keypad button "9" // The first NeoPixel in a strand is #0, second is 1, all the way up // to the count of pixels minus one. pixels.clear(); for(int i=0; i