Skip to content

Instantly share code, notes, and snippets.

@ArduinoDiscordBot
Created November 26, 2020 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArduinoDiscordBot/1261c2c929bea0e3820042c3a2b6e355 to your computer and use it in GitHub Desktop.
Save ArduinoDiscordBot/1261c2c929bea0e3820042c3a2b6e355 to your computer and use it in GitHub Desktop.
Code by Mineplayerminer SK#3639 - Thu Nov 26 2020 11:44:34 GMT+0000 (Coordinated Universal Time)

This gist was pasted by the Arduino discord server bot.

This gist was automatically pasted at the request of the code author or one of the discord server helpers. If you have any suggestions or bugs to report, you can do so on our GitHub repository, or in our discord server. This project is run by volunteers so feel free to fork and commit your changes then open a pull request!


⬇️ Pasted Code ⬇️

#include <FastLED.h>
#include <IRremote.h>
#define LED_PIN 7
#define NUM_LEDS 19
int ledmode = 0;
int color = 0;
int brightness = 255;
IRrecv irrecv(6);
CRGB leds[NUM_LEDS];
decode_results results;
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)){
// unsigned int value = results.value; pridat rezimy 25.11.2020 18:56:17-50 memento mori
if (results.value == 0X68733A46) {
ledmode++;
}
else if (results.value == 0X189D7928) {
ledmode--;
}
switch(results.value){
case 0X68733A46:
ledmode++;
break;
case 0X189D7928:
ledmode--;
break;
case 0X273009C4:
ledmode = 3;
break;
case 0XF5999288:
ledmode = 4;
break;
case 0X731A3E02:
ledmode = 5;
break;
case 0X2C452C6C:
ledmode = 6;
break;
}
irrecv.resume();
}
if (ledmode == 1) {
for(int i = 0; i < NUM_LEDS-1; i++) {
leds[i] = CRGB::Red;
FastLED.delay(100);
leds[i] = CRGB::Black;
}
}
if (ledmode == 2) {
fill_solid(leds, NUM_LEDS, CRGB (255, 255, 255));
}
FastLED.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment