#include "FastLED.h" #include #define NUM_LEDS 6 #define DATA_PIN 6 #define SLAVE_ADDRESS 0x12 // Define the array of leds CRGB leds[NUM_LEDS]; void setup() { FastLED.addLeds(leds, NUM_LEDS); Wire.begin(SLAVE_ADDRESS); Wire.onReceive(receiveData); } void loop() { delay(500); } void receiveData(int byteCount) { while(Wire.available()) { if (1 == Wire.read()) { leds[0] = CRGB::Red; FastLED.show(); } else { leds[0] = CRGB::Blue; FastLED.show(); } } }